LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 5253 - [GNU Extension] Redefinition of "extern inline" function
Summary: [GNU Extension] Redefinition of "extern inline" function
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: Frontend (show other bugs)
Version: trunk
Hardware: PC All
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
: 5431 (view as bug list)
Depends on:
Blocks: 4719
  Show dependency tree
 
Reported: 2009-10-19 11:03 PDT by Douglas Gregor
Modified: 2010-03-12 00:57 PST (History)
6 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas Gregor 2009-10-19 11:03:47 PDT
GCC allows redefinition of an "extern inline" function in GNU89 mode, accepting the following code:

  extern inline int f(int a) { return a; }
  int f(int b) { return b; }

which Clang rejects with

$ clang -std=gnu89 foo.c
foo.c:3:5: error: redefinition of 'f'
int f(int b) { return b; }
    ^
foo.c:1:19: note: previous definition is here
extern inline int f(int a) { return a; }
                  ^
2 diagnostics generated.

We previously decided that we would not implement this feature (see bug #4719), but apparently this extension is used by Wine:

  http://lists.cs.uiuc.edu/pipermail/cfe-dev/2009-October/006766.html

We should reconsider.
Comment 1 Edward O'Callaghan 2009-11-08 13:21:07 PST
*** Bug 5431 has been marked as a duplicate of this bug. ***
Comment 2 Sascha Wildner 2009-11-08 13:32:51 PST
gcc 4.1.2 also uses this extension.
Comment 3 Charles Davis 2010-02-17 20:01:45 PST
I just checked the fix in now.