JDK-8160356 : invalid suffix on literal warning is occurred with GCC 6
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-06-27
  • Updated: 2016-08-23
  • Resolved: 2016-07-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b128Fixed
Description
/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/moduleEntry.cpp:378:16: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
   st->print_cr("entry "PTR_FORMAT" name %s module "PTR_FORMAT" loader %s version %s location %s strict %s next "PTR_FORMAT,
                ^
/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/moduleEntry.cpp:378:34: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
   st->print_cr("entry "PTR_FORMAT" name %s module "PTR_FORMAT" loader %s version %s location %s strict %s next "PTR_FORMAT,
                                  ^
/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/moduleEntry.cpp:378:62: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
   st->print_cr("entry "PTR_FORMAT" name %s module "PTR_FORMAT" loader %s version %s location %s strict %s next "PTR_FORMAT,
                                                              ^
cc1plus: all warnings being treated as errors

----

/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/packageEntry.cpp:300:16: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
   st->print_cr("package entry "PTR_FORMAT" name %s module %s classpath_index "
                ^
/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/packageEntry.cpp:301:86: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
                INT32_FORMAT " is_exported_unqualified %d is_exported_allUnnamed %d " "next "PTR_FORMAT,
                                                                                      ^
cc1plus: all warnings being treated as errors

----

/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/gc/shared/preservedMarks.cpp:51:29: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
   assert(_stack.is_empty(), "stack expected to be empty, size = "SIZE_FORMAT,
                             ^
/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/gc/shared/preservedMarks.cpp:54:10: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
          "stack expected to have no cached segments, cache size = "SIZE_FORMAT,
          ^
cc1plus: all warnings being treated as errors
Comments
While it's good to fix this generally, for when we move to later C++ standards, JDK-8156980 being fixed means these warnings won't be present any more (-std=gnu++98 is again applied to the HS build).
13-07-2016