Traffic Server
  1. Traffic Server
  2. TS-125

Cannot use user-defined types in typedef of template function

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.0
    • Component/s: Portability
    • Labels:
      None
    • Environment:

      OpenSolaris with SunStudio (gcc on opensolaris fails the same code with a different error; same workaround fixes it)

      Description

      This appears to be related to Sun bug http://bugs.sun.com/view_bug.do?bug_id=6906118
      but is sufficiently different that the workaround suggested there doesn't apply.

      Compiling DAllocator.h produces the following fatal error:

      "DAllocator.h", line 86: Error: Unexpected type name "AllocPoolDescriptor" encountered.
      "DAllocator.h", line 87: Error: Unexpected type name "AllocDescriptor" encountered.

      It can be worked around by reverting:

      @@ -83,8 +83,8 @@
      int alignment;
      int el_size;

      • SList(AllocPoolDescriptor,link) pools;
      • Que(AllocDescriptor,link) free_list;
        + SLL<AllocPoolDescriptor> pools;
        + Queue<AllocDescriptor> free_list;

      Expanding that with the -E option to CC reveals that this loses an offsetof argument, so if we could fix the offset to zero then the problem goes away. If at all possible, it would be good to make "link" the first element of AllocDescriptor and AllocPoolDescriptor so the need for offsetof goes away.

      1. 0001-TS125_offsetof_jp_v2.diff.patch
        105 kB
        George Paul
      2. ts-125-offsetof-jp-v1.patch
        79 kB
        John Plevyak

        Issue Links

          Activity

            People

            • Assignee:
              John Plevyak
              Reporter:
              Nick Kew
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development