This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: preprocessor/7029: preprocessor should ignore #warning with -M
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: wolfgang dot bangerth at iwr dot uni-heidelberg dot de, gcc-gnats at gcc dot gnu dot org,gcc-bugs at gcc dot gnu dot org
- Date: Mon, 1 Jul 2002 14:20:38 -0700
- Subject: Re: preprocessor/7029: preprocessor should ignore #warning with -M
- References: <20020614112002.30933.qmail@sources.redhat.com> <20020701210449.GA25719@daikokuya.co.uk>
On Mon, Jul 01, 2002 at 10:04:49PM +0100, Neil Booth wrote:
> > IMHO, warnings generated by #warning may be omitted when not
> > actually compiling code, for example when using -M to
> > generate dependency lists. They seem inappropriate for this
> > task.
> > >How-To-Repeat:
> > program> echo "#warning Warn about something" > x.cc
> > program> gcc -M x.cc
> > x.cc:1:2: warning: #warning Warn about something
> > x.o: x.cc
>
> Warnings are sent to stderr and the dpendency information isn't; so if
> you don't want the warnings you are free to pipe stderr to /dev/null.
> If you still wanted to retain errors but not warnings you can use -w,
> or check the compiler return code.
>
> So I disagree that there is any reason to change the existing behaviour,
> and want to close this PR. Do you agree, Zack?
Well, I think it might be reasonable for -M switches that inhibit
compilation to imply -w. Presumably the user will get all the
warnings in due course as part of the real compilation.
zw