http://llvm.org/bugs/show_bug.cgi?id=16479
Bug ID: 16479
Summary: extern inline inconsistent behavior between GCC and
Clang
Product: clang
Version: trunk
Hardware: PC
OS: Windows XP
Status: NEW
Severity: normal
Priority: P
Component: LLVM Codegen
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
$ clang --version
clang version 3.4 (http://llvm.org/git/clang.git
2726877196b41b922f10f794801b313980e1a8ad) (http://llvm.org/git/llvm.git
34b96d15764d51fa53f338e5d7be4d2aa244a945)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ gcc foo.c main.c // It works
$ clang foo.c main.c
/tmp/main-bf76f7.o: In function `isalnum':
main.c:(.text+0x0): multiple definition of `isalnum'
/tmp/foo-a6bb12.o:foo.c:(.text+0x0): first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It seems clang didn't really inline it, so that we can expect it will be a
declaration only, but clang keeps original function definition.
********
* CODE *
********
$ cat inline.h
extern inline int isalnum(int a) {
// ...
}
$ cat foo.c
#include "inline.h"
void foo() {
isalnum(0);
}
$ cat main.c
#include "inline.h"
int main() {
isalnum(0);
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs