Closed Bug 1539036 Opened 6 years ago Closed 6 years ago

Compiler warnings in JSAPI header files make life difficult for embedders

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: ptomato, Assigned: ptomato)

Details

Attachments

(1 file)

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.

Priority: -- → P3
Keywords: checkin-needed

Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/95b868ac0a0a
Mark JSAPI headers as "system headers". r=sfink

Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Assignee: nobody → philip.chimento
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: