<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - GCC warns about a reserved destructor priority on llvm_writeout_and_clear"
   href="https://bugs.llvm.org/show_bug.cgi?id=47399">47399</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>GCC warns about a reserved destructor priority on llvm_writeout_and_clear
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jistone@redhat.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, maskray@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>From Rust: <a href="https://github.com/rust-lang/rust/pull/76224#issuecomment-685880913">https://github.com/rust-lang/rust/pull/76224#issuecomment-685880913</a>
Since: <a href="https://reviews.llvm.org/D82253">https://reviews.llvm.org/D82253</a>

../lib/profile/GCDAProfiling.c:637:1: warning: destructor priorities from 0 to
100 are reserved for the implementation [-Wprio-ctor-dtor]
  637 | static void llvm_writeout_and_clear(void) {
      | ^~~~~~

That function in full:

#ifndef _WIN32
// __attribute__((destructor)) and destructors whose priorities are greater
than
// 100 run before this function and can thus be tracked. The priority is
// compatible with GCC 7 onwards.
__attribute__((destructor(100)))
#endif
static void llvm_writeout_and_clear(void) {
  llvm_writeout_files();
  fn_list_remove(&writeout_fn_list);
}

GCC has MAX_RESERVED_INIT_PRIORITY 100, and warns for anything <= MAX. Perhaps
this should use 101?</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>