RFR: 8214976: Warn about uses of functions replaced for portability [v2]

Kim Barrett kbarrett at openjdk.java.net
Thu Jan 6 10:16:16 UTC 2022


On Wed, 5 Jan 2022 20:36:13 GMT, Harold Seigel <hseigel at openjdk.org> wrote:

>> src/hotspot/share/utilities/compilerWarnings.hpp line 87:
>> 
>>> 85:   PRAGMA_DISABLE_GCC_WARNING("-Wattribute-warning")
>>> 86: 
>>> 87: FORBID_C_FUNCTION(void abort(void),                            "use os::abort");
>> 
>> It would be better to put all of these after all the `#endif`, so that if we add macro implementations for other platforms (like windows), these will be covered by the additional platforms.
>
> Done.

"after all the `#endif`" wasn't quite what I meant.  Still needs to be inside the include guard.  And I forgot there are platform-specific compilerWarnings files; the gcc macro definitions should be in compilerWarnings_gcc.hpp rather than conditionally defined here.  This file should contain something like

#ifndef FORBID_C_FUNCTION
#define FORBID_C_FUNCTION(signature, alternative)
#endif

#ifndef PRAGMA_PERMIT_FORBIDDEN_C_FUNCTION
#define PRAGMA_PERMIT_FORBIDDEN_C_FUNCTION(name)
#endif

-------------

PR: https://git.openjdk.java.net/jdk/pull/6961


More information about the hotspot-dev mailing list