4.2::SYSV compatability problem

BostonU SysMgr root%bostonu.csnet at csnet-relay.arpa
Tue Jan 29 18:40:17 AEST 1985


Apologies in advance if this has been resolved in the past or I am being
dense (although that means several people here got denseness problems):

Under 4.2bsd if, say, you have a foo.h file with a line like:

	int thing ;

and include it in a few .c files everything goes fine. In SYS5
(we are running SYS5.2 on a 3B5) you get 'multiply defined' errors.
Ok, not unexpected. I have in the past just changed such a file to
something like:

#ifdef MAIN
#define EXTERN
#else
#define EXTERN extern
#endif

EXTERN int thing ;

And defined MAIN in only one place (like where main() occurs.)

Problem: Suppose now you are faced with a program with about 40 .h files
and probably hundreds of such indiscretions. WORSE: many many typedefs
making something like 'g/int /s//EXTERN int /' (if I may speak ed in
mixed company) for each C type not enough.

What's a nurd to do? 'Fixing' SYS5 ld certainly comes to mind,
(apparently berkeley already took this course once) any other
suggestions welcome as it will be a few weeks before sources arrive and
I got things to get on with....

Tx in advance.

	-Barry Shein, Boston University



More information about the Comp.unix.wizards mailing list