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

Undefined behavior in LogConfiguration::configure_stdout.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 11
    • 9, 10
    • hotspot
    • generic
    • os_x

      The new XCode9 cannot be used for jdk because it cause a build failure in LogConfiguration::configure_stdout.

      The output is:
      ============================
      open/src/hotspot/share/logging/logConfiguration.cpp:303:16: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]
        va_start(ap, exact_match);
                     ^
      open/src/hotspot/share/logging/logConfiguration.cpp:299:66: note: parameter of type 'bool' is declared here
      void LogConfiguration::configure_stdout(LogLevelType level, bool exact_match, ...) {
                                                                       ^
      1 error generated.
      ============================

      http://en.cppreference.com/w/cpp/language/variadic_arguments#Default_conversions

      "bool, char, short, and unscoped enumerations are converted to int or wider integer types as in integer promotion "

      "The behavior of the va_start macro is undefined if the last parameter before the ellipsis has reference type, or has type that is not compatible with the type that results from default argument promotions."

            mlarsson Marcus Larsson (Inactive)
            serb Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: