mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8030350: Enable additional compiler warnings for GCC
Reviewed-by: dholmes, coleenp, erikj, tbell, ihse
This commit is contained in:
parent
a752b0b503
commit
b633a889a7
4 changed files with 5 additions and 5 deletions
|
@ -260,7 +260,7 @@ ifeq ($(USE_CLANG), true)
|
||||||
WARNINGS_ARE_ERRORS += -Wno-empty-body
|
WARNINGS_ARE_ERRORS += -Wno-empty-body
|
||||||
endif
|
endif
|
||||||
|
|
||||||
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value
|
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wformat=2 -Wno-error=format-nonliteral
|
||||||
|
|
||||||
ifeq ($(USE_CLANG),)
|
ifeq ($(USE_CLANG),)
|
||||||
# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
|
# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
|
||||||
|
@ -289,7 +289,7 @@ CFLAGS += -fno-strict-aliasing
|
||||||
# The flags to use for an Optimized g++ build
|
# The flags to use for an Optimized g++ build
|
||||||
ifeq ($(OS_VENDOR), Darwin)
|
ifeq ($(OS_VENDOR), Darwin)
|
||||||
# use -Os by default, unless -O3 can be proved to be worth the cost, as per policy
|
# use -Os by default, unless -O3 can be proved to be worth the cost, as per policy
|
||||||
# <http://wikis.sun.com/display/OpenJDK/Mac+OS+X+Port+Compilers>
|
# <https://wiki.openjdk.java.net/display/MacOSXPort/Compiler+Errata>
|
||||||
OPT_CFLAGS_DEFAULT ?= SIZE
|
OPT_CFLAGS_DEFAULT ?= SIZE
|
||||||
else
|
else
|
||||||
OPT_CFLAGS_DEFAULT ?= SPEED
|
OPT_CFLAGS_DEFAULT ?= SPEED
|
||||||
|
|
|
@ -214,7 +214,7 @@ ifeq ($(USE_CLANG), true)
|
||||||
WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
|
WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
|
||||||
endif
|
endif
|
||||||
|
|
||||||
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value
|
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wno-error=format-nonliteral
|
||||||
|
|
||||||
ifeq ($(USE_CLANG),)
|
ifeq ($(USE_CLANG),)
|
||||||
# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
|
# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
|
||||||
|
|
|
@ -118,7 +118,7 @@ endif
|
||||||
# Compiler warnings are treated as errors
|
# Compiler warnings are treated as errors
|
||||||
WARNINGS_ARE_ERRORS = -Werror
|
WARNINGS_ARE_ERRORS = -Werror
|
||||||
# Enable these warnings. See 'info gcc' about details on these options
|
# Enable these warnings. See 'info gcc' about details on these options
|
||||||
WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
|
WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef -Wformat=2 -Wno-error=format-nonliteral
|
||||||
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
|
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
|
||||||
# Special cases
|
# Special cases
|
||||||
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
|
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
|
||||||
|
|
|
@ -1834,7 +1834,7 @@ void os::jvm_path(char *buf, jint buflen) {
|
||||||
jrelib_p = buf + len;
|
jrelib_p = buf + len;
|
||||||
snprintf(jrelib_p, buflen-len, "/%s", COMPILER_VARIANT);
|
snprintf(jrelib_p, buflen-len, "/%s", COMPILER_VARIANT);
|
||||||
if (0 != access(buf, F_OK)) {
|
if (0 != access(buf, F_OK)) {
|
||||||
snprintf(jrelib_p, buflen-len, "");
|
snprintf(jrelib_p, buflen-len, "%s", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the path exists within JAVA_HOME, add the JVM library name
|
// If the path exists within JAVA_HOME, add the JVM library name
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue