This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Warnings in the C++ Front-End and GCC in General
- To: mark at markmitchell dot com, egcs-patches at cygnus dot com
- Subject: Re: Warnings in the C++ Front-End and GCC in General
- From: Martin Knoblauch <knobi at rocketmail dot com>
- Date: Mon, 7 Sep 1998 16:18:30 -0700 (PDT)
- Cc: egcs at cygnus dot com, Jason Merrill <jason at cygnus dot com>
- Reply-To: knobi at knobisoft dot de
---Mark Mitchell <mark@markmitchell.com> wrote:
>
>
>
> As of yet, there is no way to turn off warnings in a particular block
> of code, although this was the main motivation for this work. The
> reason is that I believe the logical way to do this is via `#pragma',
> e.g.:
>
> #pragma gcc_diable_warn (62)
> ...
> #pragma gcc_enable_warn (62)
>
> However, I did *not* implement this (although it will now be trivial),
> because GCC has traditionally eschewed #pragma. In fact, the GCC
> manual says:
>
> It is basically a mistake to use `#pragma' for *anything*.
>
> I believe this to be an over-statement. For this particular
> situation, I think `#pragma' is the way to go. If I do not hear
> violent disagreement in the next few days, I will go ahead and
> implement this.
>
What is the problem (besides non-portability) of '#pragma'?
Anyway, in addition to the two pragma's you mentioned, a third
one:
#pragma gcc_warn_once (number)
would be useful. It would allow to warn exactely once
for every occurence[/file]. For e.g. X-header files you
would see the warning, but would not be swamped.
Martin
===
------------------------------------------------------
Martin Knoblauch
email: knobi@knobisoft.de or knobi@rocketmail.com
www: http://www.knobisoft.de
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com