named warnings & individual warning control

DJ Delorie dj@redhat.com
Wed Jun 23 21:00:00 GMT 2004


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.



More information about the Gcc mailing list