From 135d41cfad044fc8cfaf02c86d410cb280269ca3 Mon Sep 17 00:00:00 2001 From: xlu Date: Thu, 26 Jun 2008 14:15:01 -0700 Subject: [PATCH] 6718830: Hotspot fails to build with gcc 4.3 Summary: Fixed linux make file and couple adlc code to meet the changes of gcc 4.3 Reviewed-by: kamg, igor --- make/linux/makefiles/gcc.make | 9 +++++++++ src/share/vm/adlc/adlc.hpp | 4 ---- src/share/vm/adlc/filebuff.hpp | 6 +----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/make/linux/makefiles/gcc.make b/make/linux/makefiles/gcc.make index a158786a8..0d56be485 100644 --- a/make/linux/makefiles/gcc.make +++ b/make/linux/makefiles/gcc.make @@ -84,8 +84,17 @@ endif # Compiler warnings are treated as errors WARNINGS_ARE_ERRORS = -Werror + # Except for a few acceptable ones +# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit +# conversions which might affect the values. To avoid that, we need to turn +# it off explicitly. +ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" +ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare +else ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare +endif + CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS) # Special cases CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) diff --git a/src/share/vm/adlc/adlc.hpp b/src/share/vm/adlc/adlc.hpp index fc81ee00a..14bc5d6b7 100644 --- a/src/share/vm/adlc/adlc.hpp +++ b/src/share/vm/adlc/adlc.hpp @@ -29,11 +29,7 @@ // standard library constants #include "stdio.h" #include "stdlib.h" -#if _MSC_VER >= 1300 // Visual C++ 7.0 or later #include -#else -#include -#endif #include "string.h" #include "ctype.h" #include "stdarg.h" diff --git a/src/share/vm/adlc/filebuff.hpp b/src/share/vm/adlc/filebuff.hpp index fa84e09bd..fdfa985db 100644 --- a/src/share/vm/adlc/filebuff.hpp +++ b/src/share/vm/adlc/filebuff.hpp @@ -23,13 +23,9 @@ */ // FILEBUFF.HPP - Definitions for parser file buffering routines - -#if _MSC_VER >= 1300 // Visual C++ 7.0 or later #include -#else -#include -#endif +using namespace std; // STRUCTURE FOR HANDLING INPUT AND OUTPUT FILES typedef struct { const char *_name; -- GitLab