Uploaded image for project: 'Kudu'
  1. Kudu
  2. KUDU-2094

GCC 7.1 complains about alignment of Counter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • build
    • None

    Description

      I found this when building the kudu/util subtree in Impala with gcc 7.1.

      In a few places, e.g. metrics.h, the compiler complains that the alignment required by Counter is less than the alignment guaranteed by new.

          m = new Counter(proto);
      

      I worked around this by setting -faligned-new, which was added recently to GCC and is enabled by default with C++17. The setting ensures that new allocates memory with the alignment required by the data type.

      Attachments

        Activity

          People

            Unassigned Unassigned
            tarmstrong Tim Armstrong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: