[cc'ed to Brent Dax for his specific attention]

On Fri, 27 Dec 2002 20:34:33 -0500, "Dan Sugalski" wrote:
>At 1:22 AM +0000 12/27/02, Bruce Gray (via RT) wrote:
>>The gcc compiler in MinGW (win32) emits warnings for invalid 
>>pragmas in win32.h (platform.h).
>>This patch uses '#ifndef __GNUC__' to hide the pragmas from gcc.
>
>Nope--there are more compilers that aren't gcc than just MinGW.
>Is there a MinGW specific #define that can be tested instead?

Could you take a second look at the patch? Your comments 
sound like you think I want to:
        "hide the pragmas from gcc, but let MinGW see them"
when really I want to:
        "hide the pragmas from gcc (which is the same as 
        MinGW in this case)"

The C compiler in MinGW  *is* gcc, just like the compiler in 
CygWin is gcc. MinGW and CygWin are just the environments 
surrounding the build tools and the runtime libs. Any 
version of gcc will complain about the "#pragma warning()" 
lines. "#ifndef __GNUC__" is what I meant to say, because 
gcc is the only compiler that I *know* chokes on those 
pragmas. It seems likely that some other compilers 
(Borland?, Mars?) will also choke on them, but I don't yet 
know what they are, so I did not change the code for them yet.


Having said that, I see that nested "#ifndef __GNUC__", 
#ifndef __BORLAND", "#ifndef __MARS__", etc will be 
sub-optimal. The better choice is to only make the pragmas 
visible to the specific compiler that understands them. Now 
that I have done more checking, I think that compiler is 
Microsoft's. If Brent Dax will verify that his original 
intent was for those pragmas to apply only to Microsoft's C 
compiler, then an improvement would be to change one line of 
the patch from
        +#ifndef __GNUC__
to
        +#ifdef _MSC_VER

Please let me know if I have misunderstood you, or have 
muddied the issue further.

-- 
Thank you,
Bruce Gray

Reply via email to