On Sun, Mar 10, 2013 at 12:31:11AM +0100, Aleksandar Kuktin wrote:
> The compiler I normally use is GCC, which has no problems about linking
> these files.
Unless you compile with -fno-common
> Header files have this:
>
> /*extern*/ nbworks_do_align_t nbworks_do_align;
It is bad practice to have variable definitions in a header.
Add the extern to make it a declaration. Then add the definition
to a single source file in your project.
> Source files have this:
>
> struct thread_cache *
> daemon_internal_initializer(struct thread_cache *tcache) {
> extern nbworks_do_align_t nbworks_do_align;
Why declare the variable inside the function if you have a header
with a definition/declaration?
Daniel
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel