Closed Bug 624011 Opened 9 years ago Closed 9 years ago

jsval.h:301:9: warning: type of bit-field ‘payload47’ is a GCC extension

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Unassigned)

References

Details

(Whiteboard: [build_warning] fixed-in-tracemonkey)

Attachments

(1 file)

When building mozilla-central, I get at least 11 instances of this warning:
In file included from ../../dist/include/jspubtd.h:47:0,
                 from ../../dist/include/jsapi.h:49,
                 from ../../../mozilla/js/jsd/jsdebug.h:57,
                 from ../../../mozilla/js/jsd/jsd.h:81,
                 from ../../../mozilla/js/jsd/jsd_step.c:42:
../../dist/include/jsval.h:301:9: warning: type of bit-field 'payload47' is a GCC extension

This triggers tons of warning-spam, since jsval.h is indirectly included by multiple files, and most instances of the warning are prefixed with 4-6 lines of "included from..." as above.

The line of code that's flagged by the warning is:
> 301         uint64             payload47 : 47;
which was added in bug 549143.

Maybe we should just disable this GCC warning (maybe just for this chunk of code)?
Ohh, are all the warnings from .c files?
Looks like it.  Here's the biggest (only?) chunk of this warning-spam that I see (in a build with -j10 so some stuff might be out-of-order) -- looks like the final line in each of these is a .c file.

{
jsd_text.c
In file included from ../../dist/include/jspubtd.h:47:0,
                 from ../../dist/include/jsapi.h:49,
                 from ../../../mozilla/js/jsd/jsdebug.h:57,
                 from ../../../mozilla/js/jsd/jsd.h:81,
                 from ../../../mozilla/js/jsd/jsdebug.c:42:
../../dist/include/jsval.h:301:9: warning: type of bit-field ‘payload47’ is a GCC extension
../../../mozilla/js/jsd/jsdebug.c: In function ‘JSD_EnableSingleStepInterrupts’:
../../../mozilla/js/jsd/jsdebug.c:584:5: warning: implicit declaration of function ‘jsd_EnableSingleStepInterrupts’
jsd_val.c
In file included from ../../dist/include/jspubtd.h:47:0,
                 from ../../dist/include/jsapi.h:49,
                 from ../../../mozilla/js/jsd/jsdebug.h:57,
                 from ../../../mozilla/js/jsd/jsd.h:81,
                 from ../../../mozilla/js/jsd/jsd_lock.c:50:
../../dist/include/jsval.h:301:9: warning: type of bit-field 'payload47' is a GCC extension
jsd_xpc.cpp
In file included from ../../dist/include/jspubtd.h:47:0,
                 from ../../dist/include/jsapi.h:49,
                 from ../../../mozilla/js/jsd/jsdebug.h:57,
                 from ../../../mozilla/js/jsd/jsd.h:81,
                 from ../../../mozilla/js/jsd/jsd_hook.c:42:
../../dist/include/jsval.h:301:9: warning: type of bit-field ‘payload47’ is a GCC extension
In file included from ../../dist/include/jspubtd.h:47:0,
                 from ../../dist/include/jsapi.h:49,
                 from ../../../mozilla/js/jsd/jsdebug.h:57,
                 from ../../../mozilla/js/jsd/jsd.h:81,
                 from ../../../mozilla/js/jsd/jsd_atom.c:42:
../../dist/include/jsval.h:301:9: warning: type of bit-field ‘payload47’ is a GCC extension
In file included from ../../dist/include/jspubtd.h:47:0,
                 from ../../dist/include/jsapi.h:49,
                 from ../../../mozilla/js/jsd/jsdebug.h:57,
                 from ../../../mozilla/js/jsd/jsd.h:81,
                 from ../../../mozilla/js/jsd/jsd_val.c:42:
../../dist/include/jsval.h:301:9: warning: type of bit-field ‘payload47’ is a GCC extension
In file included from ../../dist/include/jspubtd.h:47:0,
                 from ../../dist/include/jsapi.h:49,
                 from ../../../mozilla/js/jsd/jsdebug.h:57,
                 from ../../../mozilla/js/jsd/jsd.h:81,
                 from ../../../mozilla/js/jsd/jsd_high.c:42:
../../dist/include/jsval.h:301:9: warning: type of bit-field 'payload47' is a GCC extension
In file included from ../../dist/include/jspubtd.h:47:0,
                 from ../../dist/include/jsapi.h:49,
                 from ../../../mozilla/js/jsd/jsdebug.h:57,
                 from ../../../mozilla/js/jsd/jsd.h:81,
                 from ../../../mozilla/js/jsd/jsd_stak.c:42:
../../dist/include/jsval.h:301:9: warning: type of bit-field 'payload47' is a GCC extension
In file included from ../../dist/include/jspubtd.h:47:0,
                 from ../../dist/include/jsapi.h:49,
                 from ../../../mozilla/js/jsd/jsdebug.h:57,
                 from ../../../mozilla/js/jsd/jsd.h:81,
                 from ../../../mozilla/js/jsd/jsd_obj.c:42:
../../dist/include/jsval.h:301:9: warning: type of bit-field 'payload47' is a GCC extension
../../../mozilla/js/jsd/jsd_obj.c: In function 'jsd_Constructing':
../../../mozilla/js/jsd/jsd_obj.c:161:26: warning: assignment from incompatible pointer type
In file included from ../../dist/include/jspubtd.h:47:0,
                 from ../../dist/include/jsapi.h:49,
                 from ../../../mozilla/js/jsd/jsdebug.h:57,
                 from ../../../mozilla/js/jsd/jsd.h:81,
                 from ../../../mozilla/js/jsd/jsd_step.c:42:
../../dist/include/jsval.h:301:9: warning: type of bit-field 'payload47' is a GCC extension
In file included from ../../dist/include/jspubtd.h:47:0,
                 from ../../dist/include/jsapi.h:49,
                 from ../../../mozilla/js/jsd/jsdebug.h:57,
                 from ../../../mozilla/js/jsd/jsd.h:81,
                 from ../../../mozilla/js/jsd/jsd_text.c:43:
../../dist/include/jsval.h:301:9: warning: type of bit-field ‘payload47’ is a GCC extension
In file included from ../../dist/include/jspubtd.h:47:0,
                 from ../../dist/include/jsapi.h:49,
                 from ../../../mozilla/js/jsd/jsdebug.h:57,
                 from ../../../mozilla/js/jsd/jsd.h:81,
                 from ../../../mozilla/js/jsd/jsd_scpt.c:42:
../../dist/include/jsval.h:301:9: warning: type of bit-field ‘payload47’ is a GCC extension
}

I'm building with gcc-4.5 & g++-4.5 on 64-bit Ubuntu 10.10, FWIW.
Cool, then it looks like we can just #ifdef off C.  This whole struct is, as the name says, just for ease of gdb'ing.
Attached patch fix?Splinter Review
(In reply to comment #3)
> Cool, then it looks like we can just #ifdef off C.

Like so?
Attachment #502159 - Flags: review?(lw)
(This does seem to fix the build warnings for me, FWIW)
Comment on attachment 502159 [details] [diff] [review]
fix?

It would be a little shorter to do
 #if !(defined(_WIN64) || defined(__cplusplus))
Attachment #502159 - Flags: review?(lw) → review+
(In reply to comment #6)
> It would be a little shorter to do
>  #if !(defined(_WIN64) || defined(__cplusplus))
I think you mean
   #if (!defined(_WIN64) && defined(__cplusplus))
right?
hehe, yes :)
Landed: http://hg.mozilla.org/tracemonkey/rev/3d9329ed0363
Whiteboard: [build_warning] → [build_warning] fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/3d9329ed0363
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.