Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-47679

Silence build warnings from tcmalloc aliases

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.7.0
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Service arch 2020-05-04

      tcmalloc is sloppy with function aliases, and it emits warnings during a normal build of mongod with the flags we give it from scons. We can specify "-Wno-attribute-alias" to shut the warnings up.

      [353/3950] Compiling build/dynamic_gcc_ninja/third_party/gperftools-2.7/dist/src/tcmalloc.dyn.o
      src/third_party/gperftools-2.7/dist/src/tcmalloc.cc:2128:36: warning: ‘void tc_delete_aligned_nothrow(void*, std::align_val_t, const std::nothrow_t&)’ alias between functions of incompatible types ‘void(void*, std::align_val_t, const std::nothrow_t&)’ and ‘void(void*)’ [-Wattribute-alias]
       extern "C" PERFTOOLS_DLL_DECL void tc_delete_aligned_nothrow(void* p, std::align_val_t, const std::nothrow_t&) PERFTOOLS_NOTHROW
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~
      src/third_party/gperftools-2.7/dist/src/tcmalloc.cc:2014:36: note: aliased declaration here
       extern "C" PERFTOOLS_DLL_DECL void tc_delete(void* p) PERFTOOLS_NOTHROW
                                          ^~~~~~~~~
      src/third_party/gperftools-2.7/dist/src/tcmalloc.cc:2119:36: warning: ‘void tc_delete_sized_aligned(void*, size_t, std::align_val_t)’ alias between functions of incompatible types ‘void(void*, size_t, std::align_val_t)’ {aka ‘void(void*, long unsigned int, std::align_val_t)’} and ‘void(void*)’ [-Wattribute-alias]
       extern "C" PERFTOOLS_DLL_DECL void tc_delete_sized_aligned(void* p, size_t size, std::align_val_t align) PERFTOOLS_NOTHROW
                                          ^~~~~~~~~~~~~~~~~~~~~~~
      src/third_party/gperftools-2.7/dist/src/tcmalloc.cc:2014:36: note: aliased declaration here
       extern "C" PERFTOOLS_DLL_DECL void tc_delete(void* p) PERFTOOLS_NOTHROW
                                          ^~~~~~~~~
      src/third_party/gperftools-2.7/dist/src/tcmalloc.cc:2108:36: warning: ‘void tc_delete_aligned(void*, std::align_val_t)’ alias between functions of incompatible types ‘void(void*, std::align_val_t)’ and ‘void(void*)’ [-Wattribute-alias]
       extern "C" PERFTOOLS_DLL_DECL void tc_delete_aligned(void* p, std::align_val_t) PERFTOOLS_NOTHROW
                                          ^~~~~~~~~~~~~~~~~
      src/third_party/gperftools-2.7/dist/src/tcmalloc.cc:2014:36: note: aliased declaration here
       extern "C" PERFTOOLS_DLL_DECL void tc_delete(void* p) PERFTOOLS_NOTHROW
                                          ^~~~~~~~~
      src/third_party/gperftools-2.7/dist/src/tcmalloc.cc:2026:36: warning: ‘void tc_delete_nothrow(void*, const std::nothrow_t&)’ alias between functions of incompatible types ‘void(void*, const std::nothrow_t&)’ and ‘void(void*)’ [-Wattribute-alias]
       extern "C" PERFTOOLS_DLL_DECL void tc_delete_nothrow(void* p, const std::nothrow_t&) PERFTOOLS_NOTHROW
                                          ^~~~~~~~~~~~~~~~~
      src/third_party/gperftools-2.7/dist/src/tcmalloc.cc:1923:6: note: aliased declaration here
       void tc_free(void* ptr) PERFTOOLS_NOTHROW {
            ^~~~~~~
      
      

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: