Code generation for variadic function emits redundant casts

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • None
    • Affects Version/s: None
    • Component/s: tools
    • None

      Consider this C function:

      ```
      int foo(int n, ...);
      ```

      This generates the following:

      ```
      public static foo$invoker foo$makeInvoker(MemoryLayout... layouts) { ... }

      ...

          public static int foo(int n, Object... x1) {
              MemoryLayout[] inferredLayouts$ = foo_h.inferVariadicLayouts(x1);
              return (int) foo$makeInvoker(inferredLayouts$).foo(n, x1);
          }
      ```

      The second static method contains a redundant cast for the return value of foo$makeInvoker.

      Also, the use of a dollar in the foo$invoker name is probably no longer consistent with the other generated names.

            Assignee:
            Maurizio Cimadamore
            Reporter:
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: