This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Fix problematic -Wcast-qual cases using new CONST_CAST macro
On Mon, 6 Aug 2007, Kaveh R. GHAZI wrote:
| On Sun, 5 Aug 2007, Mark Mitchell wrote:
|
| > Until we provide some way to turn off warnings in a local region of
| > code, I'd rather we just accept that we can't be quite -Wcast-qual
| > clean. Use it as an incentive to fix the compiler, either to make the
| > warning smarter (by, for example, allowing casts in the argument to
| > "free", or by allowing fine-grained warning control).
|
| How about a __nowarn__ keyword that works similar to __extension__?
| Instead of twiddling the pedantic flag, it would push/pop the
| inhibit_warnings variable inside gcc to silence warnings at the statement
| level.
|
| I'm about halfway through a patch. If you're amenable to the idea I'll
| finish it up and post it.
I would have thought that DJ's idea of using #pragma in code text
to turn on/off warning coupled with an inline function would do.
-- Gaby