RFR: 8254364: Remove leading _ from struct/union declarations in jvmti.h

David Holmes dholmes at openjdk.java.net
Mon Oct 12 00:52:08 UTC 2020


On Sun, 11 Oct 2020 22:21:28 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> This PR changes declarations in jvmti.h like the following from
> 
> struct _jvmtiTimerInfo;
> typedef struct _jvmtiTimerInfo jvmtiTimerInfo;
> 
> to
> 
> struct jvmtiTimerInfo;
> typedef struct jvmtiTimerInfo jvmtiTimerInfo;
> 
> This way, it becomes possible to make forward declaration in C++ code like this, without assuming the knowledge of the
> `struct _jvmtiTimerInfo` type:
> struct jvmtiTimerInfo;
> 
> Please see bug report [JDK-8254364](https://bugs.openjdk.java.net/browse/JDK-8254364) for the before/after versions of
> jvmti.h, which is generated from XML.
> Tested with build tiers 1-5 in Mach5.

Hi Ioi,

A little research indicates the problem of using the same name in the typedef and the structs pre-dates even ANSI C, so
this change should be fine. Please wait for approval from serviceability team member before pushing though.
Thanks,
David

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

Marked as reviewed by dholmes (Reviewer).

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


More information about the serviceability-dev mailing list