[OpenAFS-devel] Building CVS head on Darwin

Harald Barth haba@pdc.kth.se
Mon, 07 Apr 2003 20:48:12 +0200 (CEST)


> >   -struct rxkad_stats rxkad_stats;
> >   +struct rxkad_stats rxkad_stats = {0};
> > 
> > Global data always starts out 0, according to K&R.
> 
> It doesn't make sense to me either.  But for some reason, the compiler
> doesn't seem to want to create and export the symbol in librxkad.a
> otherwise.

K&R or not, there is at least one compiler that does the init thing
wrong. And now one that does not export correctly, well, well.
I think it was some older version of xlc (AIX) where I found the
random data in a global variable when compiling ntpd. I did not
believe my eyes but all the problems went away when I added the "= 0".

Harald.