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

Incorrect format string after JDK-8339475

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 24
    • 24
    • tools
    • b18
    • os_x

      The new code use rc (an int) with a %s format string:

          rc = pthread_create(&main_thr, NULL, &apple_main, &args);
          if (rc != 0) {
              JLI_ReportErrorMessageSys("Could not create main thread, return code: %s\n", rc);
              exit(1);
          }

      The compiler should be able to catch this if JLI_ReportErrorMessageSys was declared with something like __attribute__ ((format (printf, 1, 2))).

      I didn't compile this code or test it, this bug report is based on visual code inspection only. I assume pthread_detach cannot actually fail on MacOS, so I think this is P5.

            mbaesken Matthias Baesken
            fweimer Florian Weimer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: