United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6712344 : Add -errwarn=%all to Solaris Sun Studio compiles (all warnings being fatal)

Details
Type:
Enhancement
Submit Date:
2008-06-09
Status:
Closed
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2008-08-01
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
generic
Priority:
P3
Resolution:
Duplicate
Affected Versions:
7
Fixed Versions:
7

Related Reports
Duplicate:

Sub Tasks

Description
The hotspot Makefiles should add the Sun Studio compiler option -errwarn=%all on all C++ and C compile lines to turn all warnings into fatal errors.
It appears that hotspot is not asking for more warnings from the Sun Studio C++ compiler with the +w or +w2 option. I'm not sure I'd recommend the +w2 (seems a bit too noisy), but the +w option may be worth using. I did note that it issues warnings on system or compiler owned files, which isn't helpful or comfortable. By adding -errtags, the warning messages will get tagnames, and then you can add -erroff=TAG to suppress that warning.

FYI... hotspot will NOT build with -errwarn=%all now due to a few warnings, but adding +w makes it much worse.

(The option -w turns all warnings off, +w turns more warnings on).

The Sun Studio C compiler option for max warnings is -v. It uses the same -errwarn=%all to make warnings fatal.

diff -r a49545cab84a make/solaris/makefiles/sparcWorks.make
--- a/make/solaris/makefiles/sparcWorks.make    Tue May 27 09:47:18 2008 -0700
+++ b/make/solaris/makefiles/sparcWorks.make    Mon Jul 21 09:13:12 2008 -0700
@@ -437,6 +437,17 @@ VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
 CFLAGS += $(VM_PICFLAG)
 
+# Ask for more warning errors (-w2 is too noisy)
+CFLAGS += +w
+
+# Ask for error tags on error messages
+CFLAGS += -errtags
+
+# Warnings selection
+#WARNINGS_ARE_ERRORS = -errwarn=%all
+WARNING_TAG_SUPPRESSION_LIST =
+CFLAGS_WARN = $(WARNINGS_ARE_ERRORS) $(WARNING_TAG_SUPPRESSION_LIST:%=-erroff=%)
+
 # less dynamic linking (no PLTs, please)
 #LIB_FLAGS += $(LINK_MODE)
 # %%%%% despite -znodefs, -Bsymbolic gets link errors -- Rose

                                    

Comments



Hardware and Software, Engineered to Work Together