[vtk-developers] void const TestVoidConstReturn() warning

David Gobbi david.gobbi at gmail.com
Wed Dec 28 13:13:19 EST 2011


On Wed, Dec 28, 2011 at 10:21 AM, David Doria <daviddoria at gmail.com> wrote:
> I missed some warnings on a recent patch because I turned off -Werror
> because line 612 in TestCxxFeatures.cxx warns:
>
> // gcc>=4.3 says type qualifiers ignored on function return type
> #if !defined(__HP_aCC)
> void const TestVoidConstReturn() {}
> #endif
>
> I am indeed using gcc >= 4.3 and I get (as it says in the comment) a warning
> about the type qualifier being ignored. Is there anything that can be done
> to suppress this warning on gcc >= 4.3?

You should be able to suppress it with pragmas.
Try adding this to TestCxxFeatures.cxx just before the test:

#if defined(__GNUC__) && (__GNUC__ >= 4)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#endif

And this just after the test:

#if defined(__GNUC__) && (__GNUC__ >= 4)
#pragma GCC diagnostic pop
#endif

There are already suppressions in the file for several other compilers
(clang, icc, msvc).

 - David



More information about the vtk-developers mailing list