Compiler warnings in JSAPI header files make life difficult for embedders
Categories
(Core :: JavaScript Engine, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: ptomato, Assigned: ptomato)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Compiling embedder code that includes the JSAPI headers generates a number of compiler warnings. Since embedders typically use the ESR, we get new versions of compilers enabling more compiler warnings before we get fixes for those compiler warnings in ESR.
The way I've dealt with it so far is to wrap all the JSAPI includes in a wrapper header, and write #pragma system_header
in that wrapper header:
https://gitlab.gnome.org/GNOME/gjs/blob/master/gjs/jsapi-wrapper.h#L38-40
(Unfortunately, #pragma system_header
applies to a whole file, and can't be pushed or popped.)
However, as SpiderMonkey continues to separate out functionality into individual headers rather than including jsapi.h and jsfriendapi.h for everything, this becomes less feasible.
I'd like to propose editing the pkg-config file installed with SpiderMonkey to specify the include directory using -isystem instead of -I, which should have the same effect: it marks the JSAPI headers as system headers, so warning diagnostics generated inside those headers will not be printed. This should have no effect on Firefox, since as far as I know only embedders use the pkg-config file.
Assignee | ||
Comment 1•6 years ago
|
||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/95b868ac0a0a
Mark JSAPI headers as "system headers". r=sfink
Comment 3•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Description
•