named warnings & individual warning control

Geoffrey Keating geoffk@geoffk.org
Thu Jun 24 01:13:00 GMT 2004


DJ Delorie <dj@redhat.com> writes:

> I just had an idea for a dirty hack...
> 
> Replace the warn() function with a macro that passes the FILE/LINE it
> was called from as well.  Add a pragma that lets you block messages
> based on the file/line in gcc where they're generated.  Of *course*
> they're going to change from release to release!  How could you even
> imagine otherwise? ;-)
> 
> It also has the advantage of requiring no global source changes, and
> lets you specify each individual warning.
> 
> #pragma GCC ignore-warn c-decl.c:4633
> 
> I can see this being marginally useful for debugging gcc itself, too,
> since it tells you where each warning comes from.

You might enjoy searching for '#pragma' and 'warn' in the gcc and
gcc-patches mailing list archives.  This has been discussed many times
and I believe we've already considered most possible designs.

... or, on the other hand, you might not enjoy it.  Or reading through
all the messages this produces might take up all the time you have
for this project :-).

I think I proposed something like this in 2000:

<http://gcc.gnu.org/ml/gcc/2000-06/msg00639.html>



More information about the Gcc mailing list