Displaying 2 results from an estimated 2 matches for "b1ce8e4a".
2009 Mar 07
0
[LLVMdev] global question
...acBook:~/Desktop]% gcc -c init.c
[MacBook:~/Desktop]% gcc -c main.c
[MacBook:~/Desktop]% gcc -o test init.o main.o
[MacBook:~/Desktop]% ./test
x is: 12
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090307/b1ce8e4a/attachment.html>
2009 Mar 07
3
[LLVMdev] global question
> Please correct me if I'm wrong, but how can the compiler know, that x is not
> initialized in another file which defines x as extern? It can only be
> sure, when x is declared static.
I don't think you can attach an initializer to an extern except at the
point where the variable is defined. But since x is defined here, there
would then be two definitions of x, a link-time