Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GNU Extension] Redefinition of "extern inline" function #5625

Closed
DougGregor opened this issue Oct 19, 2009 · 4 comments
Closed

[GNU Extension] Redefinition of "extern inline" function #5625

DougGregor opened this issue Oct 19, 2009 · 4 comments
Labels
bugzilla clang:frontend

Comments

@DougGregor
Copy link
Contributor

DougGregor commented Oct 19, 2009

Bugzilla Link 5253
Resolution FIXED
Resolved on Mar 12, 2010 00:57
Version trunk
OS All
Blocks #5091
CC @pwo

Extended Description

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.

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 8, 2009

*** Bug llvm/llvm-bugzilla-archive#5431 has been marked as a duplicate of this bug. ***

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 8, 2009

gcc 4.1.2 also uses this extension.

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 18, 2010

I just checked the fix in now.

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 27, 2021

mentioned in issue llvm/llvm-bugzilla-archive#5431

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla clang:frontend
Projects
None yet
Development

No branches or pull requests

2 participants