This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: suppress warnings in source code


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]