From d618bcee055332517cea61bb585e4210fea09e63 Mon Sep 17 00:00:00 2001 From: twisti Date: Tue, 7 Jan 2014 14:26:12 -0800 Subject: [PATCH] 8022263: use same Clang warnings on BSD as on Linux Reviewed-by: kvn, iveresov --- make/bsd/makefiles/gcc.make | 9 ++++----- src/share/vm/adlc/archDesc.cpp | 26 -------------------------- src/share/vm/adlc/main.cpp | 1 - src/share/vm/adlc/output_c.cpp | 17 ----------------- src/share/vm/prims/forte.cpp | 2 +- 5 files changed, 5 insertions(+), 50 deletions(-) diff --git a/make/bsd/makefiles/gcc.make b/make/bsd/makefiles/gcc.make index 9571ad7ad..52885199c 100644 --- a/make/bsd/makefiles/gcc.make +++ b/make/bsd/makefiles/gcc.make @@ -260,14 +260,13 @@ ifeq ($(USE_CLANG), true) WARNINGS_ARE_ERRORS += -Wno-empty-body endif -WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef +WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" +ifeq ($(USE_CLANG),) # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit # conversions which might affect the values. Only enable it in earlier versions. - WARNING_FLAGS = -Wunused-function - ifeq ($(USE_CLANG),) - WARNING_FLAGS += -Wconversion + ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" + WARNINGS_FLAGS += -Wconversion endif endif diff --git a/src/share/vm/adlc/archDesc.cpp b/src/share/vm/adlc/archDesc.cpp index 303106b0e..f3f5970b4 100644 --- a/src/share/vm/adlc/archDesc.cpp +++ b/src/share/vm/adlc/archDesc.cpp @@ -43,32 +43,6 @@ char *toUpper(const char *str) { return result; } -// Utilities to characterize effect statements -static bool is_def(int usedef) { - switch(usedef) { - case Component::DEF: - case Component::USE_DEF: return true; break; - } - return false; -} - -static bool is_use(int usedef) { - switch(usedef) { - case Component::USE: - case Component::USE_DEF: - case Component::USE_KILL: return true; break; - } - return false; -} - -static bool is_kill(int usedef) { - switch(usedef) { - case Component::KILL: - case Component::USE_KILL: return true; break; - } - return false; -} - //---------------------------ChainList Methods------------------------------- ChainList::ChainList() { } diff --git a/src/share/vm/adlc/main.cpp b/src/share/vm/adlc/main.cpp index 9c558a5f5..0e0ea74dc 100644 --- a/src/share/vm/adlc/main.cpp +++ b/src/share/vm/adlc/main.cpp @@ -29,7 +29,6 @@ static void usage(ArchDesc& AD); // Print usage message and exit static char *strip_ext(char *fname); // Strip off name extension static char *base_plus_suffix(const char* base, const char *suffix);// New concatenated string -static char *prefix_plus_base_plus_suffix(const char* prefix, const char* base, const char *suffix);// New concatenated string static int get_legal_text(FileBuff &fbuf, char **legal_text); // Get pointer to legal text ArchDesc* globalAD = NULL; // global reference to Architecture Description object diff --git a/src/share/vm/adlc/output_c.cpp b/src/share/vm/adlc/output_c.cpp index b3766636d..199169046 100644 --- a/src/share/vm/adlc/output_c.cpp +++ b/src/share/vm/adlc/output_c.cpp @@ -35,23 +35,6 @@ static bool is_def(int usedef) { return false; } -static bool is_use(int usedef) { - switch(usedef) { - case Component::USE: - case Component::USE_DEF: - case Component::USE_KILL: return true; break; - } - return false; -} - -static bool is_kill(int usedef) { - switch(usedef) { - case Component::KILL: - case Component::USE_KILL: return true; break; - } - return false; -} - // Define an array containing the machine register names, strings. static void defineRegNames(FILE *fp, RegisterForm *registers) { if (registers) { diff --git a/src/share/vm/prims/forte.cpp b/src/share/vm/prims/forte.cpp index 586ae6f61..7b0ce63d4 100644 --- a/src/share/vm/prims/forte.cpp +++ b/src/share/vm/prims/forte.cpp @@ -625,7 +625,7 @@ void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) { #ifdef __APPLE__ // XXXDARWIN: Link errors occur even when __attribute__((weak_import)) // is added -#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) (0) +#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) ((void) 0) #else void collector_func_load(char* name, void* null_argument_1, -- GitLab