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

Undefined behavior in LogConfiguration::configure_stdout.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 9, 10
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      os_x

      Description

      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."

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: