public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Use -Werror but don't fail on #warning directives
@ 2013-04-29 10:06 Daniel Janzon
  2013-04-29 10:11 ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Janzon @ 2013-04-29 10:06 UTC (permalink / raw)
  To: gcc-help


Hello!

I'm a fan of using #warning instead of //Fixme but I'm also a fan of compiling with -Werror.

Can those two desires somehow be reconciled? To be explicit, are there any combination of gcc flags including -Werror that will compile the following program? (Using gcc only options is totally ok.)

int main()
{
  #warning "not implemented yet"
}

All the best,
Daniel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Use -Werror but don't fail on #warning directives
  2013-04-29 10:06 Use -Werror but don't fail on #warning directives Daniel Janzon
@ 2013-04-29 10:11 ` Jonathan Wakely
  2013-04-29 11:33   ` Daniel Janzon
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2013-04-29 10:11 UTC (permalink / raw)
  To: Daniel Janzon; +Cc: gcc-help

On 29 April 2013 11:06, Daniel Janzon wrote:
> int main()
> {
>   #warning "not implemented yet"
> }

-Werror -Wno-error=cpp should do it

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Use -Werror but don't fail on #warning directives
  2013-04-29 10:11 ` Jonathan Wakely
@ 2013-04-29 11:33   ` Daniel Janzon
  2013-04-29 11:52     ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Janzon @ 2013-04-29 11:33 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help


>>On 29 April 2013 11:06, Daniel Janzon wrote:
>> int main()
>> {
>>   #warning "not implemented yet"
>> }
>
>-Werror -Wno-error=cpp should do it

Thanks, it didn't work on gcc-4.4 though:

daniel@mio$ gcc-4.4 -Werror -Wno-error=cpp -o test-warning test-warning.c
cc1: error: -Werror=cpp: No option -Wcpp
daniel@mio$ 

So maybe I'm quite likely stuck, I mean they probably added no-cpp in
later releases of gcc because it couldn't be done in earlier releases.
Of course it's possible to explicitly list all warnings I want to fail on
but that's kind of ugly.

Thanks anyway,
Daniel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Use -Werror but don't fail on #warning directives
  2013-04-29 11:33   ` Daniel Janzon
@ 2013-04-29 11:52     ` Jonathan Wakely
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Wakely @ 2013-04-29 11:52 UTC (permalink / raw)
  To: Daniel Janzon; +Cc: gcc-help

On 29 April 2013 12:33, Daniel Janzon wrote:
>
>>>On 29 April 2013 11:06, Daniel Janzon wrote:
>>> int main()
>>> {
>>>   #warning "not implemented yet"
>>> }
>>
>>-Werror -Wno-error=cpp should do it
>
> Thanks, it didn't work on gcc-4.4 though:

You didn't say you were doing a history project ;-)

(It would have helped to say you're not using a currently supported version.)

> daniel@mio$ gcc-4.4 -Werror -Wno-error=cpp -o test-warning test-warning.c
> cc1: error: -Werror=cpp: No option -Wcpp
> daniel@mio$
>
> So maybe I'm quite likely stuck, I mean they probably added no-cpp in
> later releases of gcc because it couldn't be done in earlier releases.

Right.  There is more fine-grained control over warnings in recent releases.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-29 11:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-29 10:06 Use -Werror but don't fail on #warning directives Daniel Janzon
2013-04-29 10:11 ` Jonathan Wakely
2013-04-29 11:33   ` Daniel Janzon
2013-04-29 11:52     ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).