This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][RFC] Add #pragma message ... to gcc/g++


* Simon Baldwin wrote on Mon, Jul 21, 2008 at 05:34:20PM CEST:
> Ralf Wildenhues wrote:
>>   
>> What I meant though was: your warning states that the (malformed) pragma
>> would be ignored, thus not printed.  Reading the code tells me that it
>> is printed, however. 
[...]
> It's really ignored, not printed.  GCC_BAD() is a macro that expands to  
> a warning() followed by return, so handle_pragma_message() returns  
> without reaching fnotice() on any GCC_BAD().  I'm not wildly fond of  
> this style of coding, but it's common in c-pragma.c, perhaps reflecting  
> the fact that parts of the module may be rather old.  Blending the new  
> change in seemed preferable to adding something different or uprooting  
> all the others.

Indeed.  I didn't notice the 'return' in GCC_BAD, I didn't expect it
there.  Stated very diplomatically, I'm not fond of that style either.

Sorry for chasing a wild goose here.

> Dejagnu should, I believe, be checking this by reporting any unexpected  
> '#pragma message ...' output as excess errors or warnings -- they'll  
> appear on gcc's stdout, but with no dg-message to catch them.  I've  
> added a bit of extra commentary to the test case to make this more  
> apparent -- hopefully this will explain why the test catches all it's  
> supposed to.

Ah, thanks.

Cheers,
Ralf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]