Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6712344

Add -errwarn=%all to Solaris Sun Studio compiles (all warnings being fatal)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • 7
    • 7
    • hotspot
    • generic
    • generic

      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

            Unassigned Unassigned
            ohair Kelly Ohair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: