[LLVMbugs] [Bug 16683] New: Clang doesn't support __attribute__((__externally_visible__))

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 23 10:25:17 PDT 2013


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

            Bug ID: 16683
           Summary: Clang doesn't support
                    __attribute__((__externally_visible__))
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: fanael4 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Clang impersonates GCC 4.2.1, but doesn't support
__attribute__((__externally_visible__)). This means the following code

/* __externally_visible__ was introduced in 4.1.0 */
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 401)
__attribute__((__externally_visible__))
#endif
int x;

gets a warning emitted:

x.cpp:3:16: warning: unknown attribute '__externally_visible__' ignored
[-Wattributes]
__attribute__((__externally_visible__))
               ^

That's unexpected, because the #if is meant to stop passing the attribute to a
compiler that doesn't support it. However, Clang lies and claims it's GCC
4.2.1, which does support this attribute. Of course, there's an obvious
workaround, but still.

Ideally, Clang should support it with proper semantics, i.e. running an
internalize pass should leave __externally_visible__ entities externally
visible.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130723/899aaaea/attachment.html>


More information about the llvm-bugs mailing list