Skip to content

Commit 842f801

Browse files
author
SendaoYan
committed
8339331: GCC fortify error in vm_version_linux_aarch64.cpp
Reviewed-by: dholmes
1 parent 4533109 commit 842f801

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -185,7 +185,14 @@ static bool read_fully(const char *fname, char *buf, size_t buflen) {
185185
assert(buflen >= 1, "invalid argument");
186186
int fd = os::open(fname, O_RDONLY, 0);
187187
if (fd != -1) {
188+
PRAGMA_DIAG_PUSH
189+
PRAGMA_NONNULL_IGNORED
190+
// Suppress false positive gcc warning, which may be an example of
191+
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87489
192+
// The warning also hasn't been seen with vanilla gcc release, so may also
193+
// involve some distro-specific gcc patch.
188194
ssize_t read_sz = ::read(fd, buf, buflen);
195+
PRAGMA_DIAG_POP
189196
::close(fd);
190197

191198
// Skip if the contents is just "\n" because some machine only sets

0 commit comments

Comments
 (0)