4.2 extern a DISASTER (Flame)

Wayne A. Christopher faustus at ucbcad.UUCP
Sun Jul 28 15:46:01 AEST 1985


> This is where the problem is occuring:
> 
> file1.c
> 
> int foo;
> 
> file2.c
> 
> int uses_foo()
> 
> {
>   extern int foo;
> 
>    ...
> }
> 
> If I try to run this, > I get various bus errors, etc. (it links OK). 

It has nothing to do with your declarations of foo. If this didn't
work, do you think that anything in 4.2 would compile and run?

> The only way to get foo declared as a true external is to include
> an initialization:
> 
> file1.c
> 
> int foo=0;

This is the default.

> My conclusion from all this is that the 4.2 compiler has taken something
> which was fairly easy and intuitive to use and made it so complicated
> that it is no longer useful.

It works the same as it has always worked. You are confused. Stop blaming
the compiler when your code doesn't work.

	Wayne



More information about the Comp.lang.c mailing list