Created
December 8, 2012 03:53
-
-
Save flaneur2020/4238509 to your computer and use it in GitHub Desktop.
inline.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
inline void i_hello() { | |
printf("hello\n"); | |
} | |
static inline void si_hello() { | |
printf("static inline hello\n"); | |
} | |
extern inline void ei_hello() { | |
printf("static inline hello\n"); | |
} | |
int main(int argc, char *argv[]) { | |
i_hello(); | |
si_hello(); | |
ei_hello(); | |
return 0; | |
} | |
/* | |
$ clang inline.c | |
/tmp/cc-uA9XPc.o: In function `main': | |
inline.c:(.text+0x48): undefined reference to `i_hello' | |
collect2: ld returned 1 exit status | |
clang: error: linker (via gcc) command failed with exit code 1 (use -v to see | |
invocation) | |
*/ | |
/* | |
$ gcc inline.c | |
/tmp/ccDgCZat.o: In function `main': | |
inline.c:(.text+0x39): undefined reference to `ei_hello' | |
collect2: ld returned 1 exit status | |
* */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment