RFR: 8305341: Alignment outside of HotSpot should be enforced by alignas instead of compiler specific attributes
Chris Plummer
cjplummer at openjdk.org
Fri Mar 31 19:57:18 UTC 2023
On Fri, 31 Mar 2023 06:07:39 GMT, Julian Waters <jwaters at openjdk.org> wrote:
> C11 has been stable for a long time on all platforms, so native code can use the standard alignas operator for alignment requirements
I don't have any comments on this change in general (it's not something I've dealt with in the past), but I did notice that there are a couple of places you missed:
src/hotspot/share/utilities/globalDefinitions_visCPP.hpp:119:#define ATTRIBUTE_ALIGNED(x) __declspec(align(x))
src/java.desktop/share/native/libfreetype/include/freetype/internal/ftvalid.h:82: /* __declspec(align())' in order to compile cleanly with */
src/java.desktop/share/native/libfreetype/src/smooth/ftgrays.c:484: /* __declspec(align())' in order to compile cleanly with */
For the 2nd and 3rd ones you would want to remove all of the following:
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
/* We disable the warning `structure was padded due to */
/* __declspec(align())' in order to compile cleanly with */
/* the maximum level of warnings. */
#pragma warning( push )
#pragma warning( disable : 4324 )
#endif /* _MSC_VER */
...
#if defined( _MSC_VER )
#pragma warning( pop )
#endif
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13258#issuecomment-1492522828
More information about the serviceability-dev
mailing list