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

8132379 introduced non ANSI C coding

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b129
    • Verification:
      Not verified

      Description

      Change '8132379: -J options can cause crash or "Warning: app args parsing error passing arguments as-is"' uses the following non ANSI C compatible code for declaring a block-level variable:

          for (i = 0; i < argc; i++) {
              j = appArgIdx[i];
              jboolean arg_expand = (JLI_StrCmp(stdargs[j].arg, strv[i]) == 0)
                                      ? stdargs[j].has_wildcard
                                      : JNI_FALSE;
      But ANSI C only allows the declaration of block local variable at the beginning of a block.

      As the fix is trivial, it makes no sense to restrict ourselves to compilers which support this C99 feature (like VS2013).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                simonis Volker Simonis
                Reporter:
                simonis Volker Simonis
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: