RFR: 8319818: Address GCC 13.2.0 warnings (stringop-overflow and dangling-pointer) [v2]

Mikael Vidstedt mikael at openjdk.org
Fri Nov 10 18:08:17 UTC 2023


> This PR is splitting out the GCC 13.2.0 warning related changes from #16550, excluding the Oracle/devkit parts, for clarity and to make potential backports more straightforward.
> 
> GCC 13.2.0 generates two new warnings:
> 
> * linux-aarch64-debug
> 
> src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.hpp:203:66: error: 'long unsigned int __atomic_load_8(const volatile void*, int)' writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
> 
> I did not find any way to adjust the code to avoid this warning, so I instead chose to disable it in `CompileJvm.gmk` for linux-aarch64-(fast)debug only.
> 
> * linux-zero
> 
> src/hotspot/share/runtime/thread.hpp:579:77: error: storing the address of local variable 'rm' in '*_thr_current.Thread::_current_resource_mark' [-Werror=dangling-pointer=]
> 
> Lots and lots of warnings related to ResourceMark. Thanks to @stefank for suggesting moving the ASSERT implementation of the ResourceMark constructor to the .cpp file. With that change there's no need to explicitly disable the warning.

Mikael Vidstedt has updated the pull request incrementally with one additional commit since the last revision:

  Add comment for stringop-overflow warning
  
  Co-authored-by: Hao Sun <hao.sun at arm.com>

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/16584/files
  - new: https://git.openjdk.org/jdk/pull/16584/files/47ace39f..e2baad09

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16584&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16584&range=00-01

  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/16584.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16584/head:pull/16584

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


More information about the build-dev mailing list