[cfe-dev] Weak linkage for inline

Eli Friedman eli.friedman at gmail.com
Fri Jun 27 08:54:24 PDT 2008


On Fri, Jun 27, 2008 at 4:21 AM, Argiris Kirtzidis <akyrtzi at gmail.com> wrote:
> Hi,
>
> This test case:
>
> inline void f(void) {}
>
> when compiled with llvm-gcc, produces this output:
>
> define void @f() nounwind  {
>
> but when compiled with clang, this output:
>
> define weak void @f() {
>
>
> Should clang mirror llvm-gcc and not use 'weak' linkage for inline
> functions ?

The correct comparison is with llvm-gcc -std=c99.  clang is in fact
wrong here, but it's a bit more complicated.

-Eli



More information about the cfe-dev mailing list