https://bugs.llvm.org/show_bug.cgi?id=47399

            Bug ID: 47399
           Summary: GCC warns about a reserved destructor priority on
                    llvm_writeout_and_clear
           Product: compiler-rt
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: compiler-rt
          Assignee: unassignedb...@nondot.org
          Reporter: jist...@redhat.com
                CC: llvm-bugs@lists.llvm.org, mask...@google.com

>From Rust: https://github.com/rust-lang/rust/pull/76224#issuecomment-685880913
Since: https://reviews.llvm.org/D82253

../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?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to