diff --git a/make/linux/makefiles/gcc.make b/make/linux/makefiles/gcc.make index a158786a8916b44467e4a2ba9a579a96d326db9d..0d56be485281c800ca2e674d5bca8e20c3d0de7b 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 fc81ee00a5ed83ca6217d382569ee67194ddd528..14bc5d6b7388d0fd1e83d23063a714300d15860b 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 fa84e09bd2a8267d2ca6820cfee1754897eca478..fdfa985db4c9995f2c5b6e5c58dcd44d5aec19f0 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;