This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: suppress warnings in source code
- From: "John (Eljay) Love-Jensen" <eljay at adobe dot com>
- To: Tibor Vidók <tibor dot vidok at gmail dot com>, "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 11 Nov 2009 04:57:07 -0800
- Subject: RE: suppress warnings in source code
- References: <a622aca00911110425j5ff1af4cj1d0b368291bc24a4@mail.gmail.com>
Hi Tibor,
> Is it possible somehow to suppress some gcc warnings regardless the -Wxxx command line options?
Yes and no.
The "no" being: not with GCC.
The "yes" being: you can use a program like grep to filter out the known warnings by location that you want to ignore. (Besides grep... sed, awk, perl, python, ruby would also be suitable. Whatever filter capable tool or scripting engine you are most familiar with.)
Use -fmessage-length=0 so the filter is a little easier to implement.
> Is there any attributes or pragmas which suppresses other warnings (like castings, initializations, etc) or warnings from a given line ?
No. I'm not aware of anyone working on that as a GCC feature.
If you wanted, you could try your hand at implementing such a feature for GCC and submitting it for consideration.
Sincerely,
--Eljay