[LLVMbugs] [Bug 14991] New: attribute init_priority() should trigger warning on OS X

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jan 18 04:24:22 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=14991

             Bug #: 14991
           Summary: attribute init_priority() should trigger warning on OS
                    X
           Product: clang
           Version: 3.1
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ilg at livius.net
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


After several tests I discovered that the standard Apple linker does not
support reordering of constructors.

GCC has a configuration definition 

#define SUPPORTS_INIT_PRIORITY 0

that triggers errors when attributes like

__attribute__((constructor(NNN)))
__attribute__ ((init_priority (NNN)))

are used:

OS.cpp:16:57: error: constructor priorities are not supported
OS.cpp:35:59: error: 'init_priority' attribute is not supported on this
platform

I think that clang should also trigger warnings, to notify the user that those
attributes, although properly processed within the compilation unit, will be
silently ignored by the Apple linker.


Liviu

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list