RFR: 8307058: Implementation of Generational ZGC [v3]

Axel Boldt-Christmas aboldtch at openjdk.org
Thu May 4 09:53:32 UTC 2023


On Wed, 3 May 2023 21:58:25 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

> I'm getting build warnings on all linux platforms with gcc-11.3.0:
> 
> ```
> src/hotspot/share/gc/z/zDriver.cpp:84:13: error: In the GNU C Library, "minor" is defined
>  by <sys/sysmacros.h>. For historical compatibility, it is
>  currently defined by <sys/types.h> as well, but we plan to
>  remove this soon. To use "minor", include <sys/sysmacros.h>
>  directly. If you did not intend to use a system-defined macro
>  "minor", you should undefine it after including <sys/types.h>. [-Werror]
>    84 | ZDriverMinor* ZDriver::minor() {
> ```

@TheRealMDoerr I cannot reproduce this with gcc but can see the issue with clangd.
Can you check if this patch solves the issue you are seeing?

diff --git a/src/hotspot/share/gc/z/zDriver.hpp b/src/hotspot/share/gc/z/zDriver.hpp
index 640ea6575ef..7fa650b1fa1 100644
--- a/src/hotspot/share/gc/z/zDriver.hpp
+++ b/src/hotspot/share/gc/z/zDriver.hpp
@@ -29,6 +29,14 @@
 #include "gc/z/zThread.hpp"
 #include "gc/z/zTracer.hpp"
 
+#ifdef minor
+#undef minor
+#endif
+
+#ifdef major
+#undef major
+#endif
+
 class VM_ZOperation;
 class ZDriverMinor;
 class ZDriverMajor;

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

PR Comment: https://git.openjdk.org/jdk/pull/13771#issuecomment-1534438516


More information about the hotspot-dev mailing list