Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-51910

compile warnings in phosphor when building with g++ 11

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • Morpheus
    • Morpheus
    • phosphor
    • None
    • Untriaged
    • 1
    • Unknown

    Description

      After upgrading to Ubuntu 22.04LTS I've now got g++ 11 as the default compiler, and it emits a bunch of warnings related to:

      [22/223] Building CXX object phosphor/CMakeFiles/phosphor.dir/src/trace_buffer.cc.o
      In file included from /home/trond/compile/trunk/phosphor/include/phosphor/trace_buffer.h:26,
                       from /home/trond/compile/trunk/phosphor/src/trace_buffer.cc:20:
      /home/trond/compile/trunk/phosphor/include/gsl_p/iterator.h: In instantiation of ‘class gsl_p::multidimensional_iterator<phosphor::TraceBuffer::chunk_iterator>’:
      /home/trond/compile/trunk/phosphor/src/trace_buffer.cc:169:47:   required from here
      /home/trond/compile/trunk/phosphor/include/gsl_p/iterator.h:45:28: warning: ‘this’ pointer is null [-Wnonnull]
         45 |         using U = decltype((*((T*)nullptr))->begin());
            |                            ^
      /home/trond/compile/trunk/phosphor/src/trace_buffer.cc:80:23: note: in a call to non-static member function ‘const phosphor::TraceChunk* phosphor::TraceBuffer::chunk_iterator::operator->() const’
         80 |     const TraceChunk* TraceBuffer::chunk_iterator::operator->() const {
            |                       ^~~~~~~~~~~
      In file included from /home/trond/compile/trunk/phosphor/include/phosphor/trace_buffer.h:26,
                       from /home/trond/compile/trunk/phosphor/src/trace_buffer.cc:20:
      /home/trond/compile/trunk/phosphor/include/gsl_p/iterator.h:45:28: warning: ‘this’ pointer is null [-Wnonnull]
         45 |         using U = decltype((*((T*)nullptr))->begin());
            |                            ^
      /home/trond/compile/trunk/phosphor/src/trace_buffer.cc:80:23: note: in a call to non-static member function ‘const phosphor::TraceChunk* phosphor::TraceBuffer::chunk_iterator::operator->() const’
         80 |     const TraceChunk* TraceBuffer::chunk_iterator::operator->() const {
            |                       ^~~~~~~~~~~
      

      Attachments

        For Gerrit Dashboard: MB-51910
        # Subject Branch Project Status CR V

        Activity

          People

            trond Trond Norbye
            trond Trond Norbye
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty