Closed Bug 853111 Opened 11 years ago Closed 11 years ago

Over 7700 lines of warning-spam from selfhosted.out.h, for -Wnarrowing (for converting values >= 128 to 'const char')

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(4 files, 1 obsolete file)

When building mozilla inbound today, I hit ~7700 lines of warning spam along the lines of:
{
 0:31.07 ./selfhosted.out.h:7:70405: warning: narrowing conversion of '203' from 'int' to 'const char' inside { } is ill-formed in C++11 [-Wnarrowing]
 0:31.09 ./selfhosted.out.h:7:70405: warning: narrowing conversion of '185' from 'int' to 'const char' inside { } is ill-formed in C++11 [-Wnarrowing]
 0:31.09 ./selfhosted.out.h:7:70405: warning: narrowing conversion of '236' from 'int' to 'const char' inside { } is ill-formed in C++11 [-Wnarrowing]
 0:31.09 ./selfhosted.out.h:7:70405: warning: narrowing conversion of '184' from 'int' to 'const char' inside { } is ill-formed in C++11 [-Wnarrowing]
}

(These are being spammed for the file "selfhosted.out.h", which is a generated header in $OBJDIR/js/src/, and which indeed has an array of const chars that is initialized with the values quoted above, which are out-of-range for the 'char' type.

I'm tentatively guessing that this is from 
  https://hg.mozilla.org/mozilla-central/rev/b00eb1ef1517
since that was the most recent change to self-hosted stuff, but I'm not sure.
Summary: Over 7700 lines of warning-spam from selfhosted.out.h, for -Wnarrowing (for converting a value above 128 to 'const char') → Over 7700 lines of warning-spam from selfhosted.out.h, for -Wnarrowing (for converting values >= 128 to 'const char')
I'm hitting this using GCC 4.8 from the ubuntu 13.04 "gcc-snapshot" package, BTW. 

I've been using this compiler for at least a week, and I'm pretty sure I haven't seen this build warning before today, but it might be possible that this is a new-in-GCC-4.8 version of this warning for code that's been the same for a while.
hg bisect says this actually started with this cset:
{
changeset:   125577:475c1655ce61
user:        Shu-yu Guo <shu@rfrn.org>
date:        Tue Mar 19 23:26:08 2013 -0700
summary:     Bug 814795 - Remove v8-specific tools for selfhosted code in favor of CPP (r=till)
}

Previous to that, I think the array in selfhosted.out.h only has values below 128. After that changeset, it's got larger values which trigger the massive build-warning-spam.
Blocks: 814795
Here's what selfhosted.out.h looks like in a build from d10ac6c5b14f (just before bug 814795's commit).  This one doesn't seem to have values >= 128, as noted above.
Attachment #727327 - Attachment is obsolete: true
Attachment #727333 - Attachment mime type: text/x-chdr → text/plain
...and here's the warning-spammy selfhosted.out.h, generated w/ a build from the problematic cset, 475c1655ce61.
(Superficially, it seems that changing this array to have type "unsigned char" instead of "char" would fix this.  Not sure if other things depend on it being "char" though.)
(In reply to Daniel Holbert [:dholbert] from comment #2)
> I'm hitting this using GCC 4.8 from the ubuntu 13.04 "gcc-snapshot" package,
> BTW.

(I just verified that I hit this in GCC 4.7, too -- so this isn't a 4.8-dependant thing.)
Attached patch fixSplinter Review
Attachment #727375 - Flags: review?(tschneidereit)
Comment on attachment 727375 [details] [diff] [review]
fix

Review of attachment 727375 [details] [diff] [review]:
-----------------------------------------------------------------

I should have seen that, sorry.
Attachment #727375 - Flags: review?(tschneidereit) → review+
(In reply to Till Schneidereit [:till] from comment #9)
> Comment on attachment 727375 [details] [diff] [review]
> fix
> 
> Review of attachment 727375 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> I should have seen that, sorry.

I should have too, really. :(
No worries - thanks to both of you for the quick action!
https://hg.mozilla.org/mozilla-central/rev/dee55e5465e5
https://hg.mozilla.org/mozilla-central/rev/6609ab08172e
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: