[LLVMbugs] [Bug 16766] New: clang with -fms-extensions should treat __inline in C as it treats inline in C++

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 31 15:57:58 PDT 2013


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

            Bug ID: 16766
           Summary: clang with -fms-extensions should treat __inline in C
                    as it treats inline in C++
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: reid.kleckner at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The MSDN docs spell this out:
http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx

"The inline keyword is available only in C++. The __inline and __forceinline
keywords are available in both C and C++."
...
"The __inline keyword is equivalent to inline."

In particular, this code similar to some in winnt.h will cause multiple
definition link errors:
int foo(int);
__inline int foo(int x) { return x; }

Clang will emit a strong definition for foo instead of a weak or linkonce
definition.

This prevents clang from compiling and linking multiple C files that include
windows.h.

I don't think this will break people following C99 inline rules, but it will
cause them to start emitting more linkonce code.

-- 
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/20130731/9a48fc06/attachment.html>


More information about the llvm-bugs mailing list