On Thu, 17 Aug 2023 07:44:54 GMT, Christian Hagedorn <chaged...@openjdk.org> 
wrote:

>> I see Dean indicated this is platform specific, but I don't know how. It 
>> sounds like this is a bug if it should be 64-bit.
>
> I think `uint32_t` was wrong here since it could be a larger 64-bit value on 
> 64-bit platforms. `ElfShdr` is a `typedef` for `Elf64_Shdr` here which 
> specifies `sh_offset` as `uint64_t`:
> https://github.com/openjdk/jdk/blob/43311930107d1783b742adbe567e9bdbcb55775d/src/hotspot/share/utilities/elfFile.cpp#L747-L752
> 
>  I guess `sh_offset` was just never larger than 32-bits in practice, so it 
> went unnoticed.

It was unnoticed until -Wconversion that is.  It seems reasonable that 
something called "address" should be declared as an address size.  Especially 
if address sized things are being assigned into it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15233#discussion_r1297135720

Reply via email to