RFR: 8306901: Macro offset_of confuses Eclipse CDT

Richard Reingruber rrich at openjdk.org
Fri Apr 28 06:25:57 UTC 2023


On Wed, 26 Apr 2023 09:42:52 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

> With this pr I would like to wrap the body of the macro `offset_of` as defined for gcc in parentheses to fix the described issues with Eclipse CDT.
> As an alternative the [`(int)` cast in `byte_offset_of`](https://github.com/openjdk/jdk/blob/44d9f55d0b3c469988be6f1c47f0cfbc433c4490/src/hotspot/share/utilities/sizes.hpp#L59) could be removed. I preferred adding the parentheses to the gcc version of `offset_of` because the impact is smaller.
> 
> Of course I'd rather have a local solution for the issue but I couldn't find one that didn't require changes in the source code.
> 
> Testing: GHA

Thanks for the reviews.

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

PR Comment: https://git.openjdk.org/jdk/pull/13668#issuecomment-1527035901


More information about the hotspot-dev mailing list