[comp.lang.c++] static cross references

pjmp@hrc63.co.uk (Peter Polkinghorne) (09/23/88)

There seems to be something lacking in the treatment of statics, or I am
missing something :-). With cc on Suns it is possible to declare a static
before it is defined using extern. This does seem a little dubious.
However trying this trick on CC (AT&T Cfront v1.1) produces the justifiable
complaint b static and not static.

/* test of static refs */
extern void *b;
static void * a = &b;
static void * b = &a;

main()
{
}/*main*/

/*end test*/

It would be nice to be able declare statics before they are defined so as to be
able initialise statics which refer to eachother. At present the only solution
seems to be to make one extern and thus global.

Peter Polkinghorne 	UUCP: ...!mcvax!ukc!hrc63!pjmp
"Mebyon Kernow"		DOMAIN: pjmp@uk.co.gec-rl-hrc

NB Reply to, From path in news is wrong, please use one the above for mail.