Bug 22237 - Clean up usage of #pragma in wtf so that gcc does not warn (change for Google Chromium)
Summary: Clean up usage of #pragma in wtf so that gcc does not warn (change for Google...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Minor
Assignee: Nobody
URL: http://code.google.com/p/chromium/iss...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-13 13:18 PST by Pawel Hajdan jr (ph)
Modified: 2008-12-14 12:31 PST (History)
1 user (show)

See Also:


Attachments
pragma-patch-1.diff (1.96 KB, patch)
2008-11-13 13:19 PST, Pawel Hajdan jr (ph)
no flags Details | Formatted Diff | Diff
gcc invocation and errors (15.16 KB, text/plain)
2008-11-15 04:11 PST, Pawel Hajdan jr (ph)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Hajdan jr (ph) 2008-11-13 13:18:33 PST
Will attach proposed patch for review. I couldn't test on Windows, but Google Chromium solves it similarly.
Comment 1 Pawel Hajdan jr (ph) 2008-11-13 13:19:32 PST
Created attachment 25132 [details]
pragma-patch-1.diff
Comment 2 Mark Rowe (bdash) 2008-11-13 16:43:08 PST
Why would GCC be complaining about code that is wrapped in #if COMPILER(MSVC)?
Comment 3 Pawel Hajdan jr (ph) 2008-11-13 23:49:35 PST
(In reply to comment #2)
> Why would GCC be complaining about code that is wrapped in #if COMPILER(MSVC)?

I also thought so for the first time. I think it sees *all* preprocessor directives and warns if doesn't understand some of them (-Wunknown-pragmas). I won't argue whether it's sensible or not, but it just happens.

Please also note that it is not code (which the compiler wouldn't see of course), but preprocessors directives, which preprocessor sees and may react as I wrote above.
Comment 4 Alp Toker 2008-11-14 19:14:18 PST
(In reply to comment #3)
> (In reply to comment #2)
> > Why would GCC be complaining about code that is wrapped in #if COMPILER(MSVC)?
> 
> I also thought so for the first time. I think it sees *all* preprocessor
> directives and warns if doesn't understand some of them (-Wunknown-pragmas). I
> won't argue whether it's sensible or not, but it just happens.
> 

Hi,

I can't reproduce these build warnings/errors with any combination of -Wunknown-pragmas -Wall -Werror and gcc 4.2.4 (trying on Linux, GTK+ port).

Can you post the actual compiler output including warnings in this bug and the full command line that you're invoking gcc with including the -W flags? That should give us a better idea of what's going on.

Should hold off on this patch until it's clear what's causing the warnings.
Comment 5 Pawel Hajdan jr (ph) 2008-11-15 04:11:01 PST
Created attachment 25183 [details]
gcc invocation and errors

This is actually from Chromium. GCC used is 4.3.1. Please note that compiled .cc file is from V8 bindings, but the error is in WebKit's headers. Hopefully you will manage to reproduce it (unfortunately I don't understand WebKit's build system to apply same gcc flags), and surely you will see that reported problem is "real".

One more note: the error is not present in trunk checkout of Chromium. I started removing some warning excludes (see referenced bug), and that's what happens.
Comment 6 Pawel Hajdan jr (ph) 2008-11-18 03:23:06 PST
Comment on attachment 25132 [details]
pragma-patch-1.diff

After discussion on IRC I came to conclusion that the patch may indeed be not needed. I will wait until Chromium picks up WebKit changes in this area and then re-verify.
Comment 7 Pawel Hajdan jr (ph) 2008-12-14 12:31:05 PST
It turned out the patch was wrong from the beginning. The Chromium version of WebKit when I filed this bug didn't have #if COMPILER(MSVC) guards. When it picked up more recent revision, it was fine. Closing as invalid.