RFR: 8377895: Create sizeof_auto, to reduce narrowing conversions [v2]
Leo Korinth
lkorinth at openjdk.org
Mon Feb 16 15:15:11 UTC 2026
On Mon, 16 Feb 2026 14:07:17 GMT, Leo Korinth <lkorinth at openjdk.org> wrote:
>>> I know that this isn't something that we follow today, but it's good practice to avoid underscores in test names when using Gtest. If you can call it SizeofAuto or sizeofAuto then I think that's preferred.
>>
>> Almost all of our gtest test uses underscores, so I think that Leo should stick with `_` for this PR.
>
> I would like to understand the reason for the good practice to not use underscore. Then I can make a better informed decision. In this change, I copied the style of `jlong_from` directly above. I like that I can grep on the string without first transforming it (I can do that if I use the function name unchanged), but if there is a better reason for changing the name, I will take that into consideration.
I have talked to Johan, and the reason for not using underscore is that they are problematic in C++ at the beginning and at the end of names. There is a third case if the concatenation of the test suite name and the test name is not unique which can only happen if the test suite name itself uses underscore.
All these reasons are valid, but I feel the upside of using the same convention as in the test file and being able to search on the same identifier is bigger. So I will keep the name as is (after discussing it with Johan).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29716#discussion_r2812899840
More information about the hotspot-dev
mailing list