RFR: 8218164: Improve local control of compiler warnings
David Holmes
david.holmes at oracle.com
Fri Feb 1 05:50:59 UTC 2019
Hi Kim,
On 1/02/2019 10:44 am, Kim Barrett wrote:
> Please review this extension to the existing support for locally
> disabling various compiler warnings. There are also a few updates of
> existing code to use the new mechanisms. (There are some additional
> opportunities to use these new mechanisms, but some were in code that
> Oracle doesn't test, like Win32, so I left them alone.)
>
> (Obviously one should not disable warnings lightly, but sometimes one
> does what one must.)
>
> There are several pieces to this change.
>
> First, utilities/compilerWarnings.hpp is refactored to have
> compiler-specific variants, similar to globalDefinitions.hpp. This
> hadn't been done previously because only gcc (and clang) had
> non-trivial definitions.
>
> Second, implemented PRAGMA_DIAG_PUSH/POP for Visual Studio. Still no
> implementations for xlc or solstudio though.
>
> Third, added a couple of compiler-specific warning disabling macros:
>
> PRAGMA_DISABLE_GCC_WARNING(option_string) // also applies to clang
> PRAGMA_DISABLE_MSVCPP_WARNING(num)
>
> They have useful implementations for the respective compilers and
> empty definitions otherwise.
>
> (I'm open to suggestions for better names, esp. for "MSVCPP".)
This all seems quite reasonable to me. On the naming ... if the file has
to use visCPP perhaps the macro should use VISCPP rather than MSVCPP ?
Thanks,
David
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8218164
>
> Webrev:
> http://cr.openjdk.java.net/~kbarrett/8218164/open.00/
>
> Testing:
> mach5 tier1
>
More information about the hotspot-dev
mailing list