Bug 62242

Summary: Compiling Chromium port under GCC 4.6 produces warnings about nullptr
Product: WebKit Reporter: Ryan Sleevi <rsleevi>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, thakis, tony, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Ryan Sleevi
Reported 2011-06-07 15:41:20 PDT
When compiling the Chromium port with GCC 4.6, GCC warns about the use of nullptr being a reserved keyword in c++0x. This is emitted when files include Source/JavaScriptCore/wtf/Nullptr.h This warning should be suppressed, as it is in the QT port, as the usage of nullptr is forwards-compatible when compiling in c++0x mode.
Attachments
Patch (4.64 KB, patch)
2011-06-07 15:56 PDT, Ryan Sleevi
no flags
Patch (4.61 KB, patch)
2011-06-07 19:41 PDT, Ryan Sleevi
no flags
Ryan Sleevi
Comment 1 2011-06-07 15:56:58 PDT
Nico Weber
Comment 2 2011-06-07 15:59:41 PDT
Shouldn't we rather be changing the names to not conflict with c++0x?
Nico Weber
Comment 3 2011-06-07 15:59:55 PDT
(Note: I'm not a webkit reviewer.)
Ryan Sleevi
Comment 4 2011-06-07 16:01:02 PDT
See http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/JavaScriptCore.pro for an example of how QT does it. Note that they add it for >= 4.6. This just adds for == 4.6. It also doesn't check for existing c++0x-compile; none of the Chromium code currently passes c++0x AFAICT, so I didn't believe that check was relevant (yet).
Ryan Sleevi
Comment 5 2011-06-07 16:02:48 PDT
Nico: If you check the header file, it's actually setup to use the c++0x symbol when compiling in c++0x. However, if --std=c++0x wasn't passed (for GCC), then it falls back to implementing an equivalent functionality (in the std:: namespace, which is technically undefined) The issue is GCC 4.6 doesn't realize that the code *is* setup for c++0x compilation already, and thus emits the warning in non-c++0x mode.
Ryan Sleevi
Comment 6 2011-06-07 16:04:05 PDT
http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/wtf/NullPtr.h is the file that causes the warnings, specifically.
Tony Chang
Comment 7 2011-06-07 16:16:43 PDT
Can we just put this in build/common.gypi rather than having to add it to each .gyp file?
Ryan Sleevi
Comment 8 2011-06-07 16:19:30 PDT
I went with the per-file based on evanm's suggestion for a related GCC 4.6 suppression ( http://codereview.chromium.org/7111026/ ). His preference, if I understand correctly, is to place the suppression as close to the offending code as possible. I don't think we'd necessarily want to suppress the warning for other code (eg: third-party libs, Chromium proper, etc), even though there weren't any other incidents that I could tell.
Tony Chang
Comment 9 2011-06-07 17:02:45 PDT
Comment on attachment 96320 [details] Patch Evan tells me he sees an argument for either way. I'm guess I'm fine with either way as well.
WebKit Review Bot
Comment 10 2011-06-07 19:31:48 PDT
Comment on attachment 96320 [details] Patch Rejecting attachment 96320 [details] from commit-queue. Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=ec2-cq-01', '--port..." exit_code: 2 Last 500 characters of output: contain OOPS: trunk/Source/WebCore/ChangeLog Please don't ever say "OOPS" in a ChangeLog file. at /usr/lib/git-core/git-svn line 572 Failed to run "[u'git', u'svn', u'dcommit']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue/ Updating OpenSource Current branch master is up to date. Updating chromium port dependencies using gclient... ________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' Updating webkit projects from gyp files... Full output: http://queues.webkit.org/results/8777422
Ryan Sleevi
Comment 11 2011-06-07 19:41:19 PDT
WebKit Review Bot
Comment 12 2011-06-08 11:04:54 PDT
Comment on attachment 96362 [details] Patch Clearing flags on attachment: 96362 Committed r88360: <http://trac.webkit.org/changeset/88360>
WebKit Review Bot
Comment 13 2011-06-08 11:04:59 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.