RFR: 8306901: Macro offset_of confuses Eclipse CDT

Richard Reingruber rrich at openjdk.org
Wed Apr 26 16:15:56 UTC 2023


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

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

Commit messages:
 - v1

Changes: https://git.openjdk.org/jdk/pull/13668/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13668&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8306901
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/13668.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13668/head:pull/13668

PR: https://git.openjdk.org/jdk/pull/13668


More information about the hotspot-dev mailing list