On 7 June 2011 15:05, Herman, Geza wrote: > > However, for my construct, which appears to be completely legal, I get a > warning, which I'd like to disable. How can I do that? Currently I'm using > -Wno-strict-aliasing, but I'd like to have a better solution. I tried to > cast (void*) before the cast to (OBJECT*), it didn't help. Is it possible > to disable this warning for this line only (maybe with some GCC specific > tricks)?
You might be able to use these: http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html N.B. the push/pop functionality was added in GCC 4.6 and the places where #pragma GCC diagnostic could appear in your source file was more limited before GCC 4.6, see the 4.4 and 4.5 manuals for details.