Let ME try for a new topic...exorcising extern

Mike Lutz mjl at ritcv.UUCP
Wed Jun 6 04:11:13 AEST 1984


While I agree with Henry Spencer that external variables are ugly and
error-prone in general, there are a few cases where their use, if not
elegant, is at least acceptable.  My approach is to put all such glop
in a file called externs.c, and, in the Makefile, have externs.h depend
on externs.c. The associated action uses sed to insert `extern' as
appropriate and to remove cruft such as initializers.

This approach has great deterrent value.  Watching the intermodule
coupling increase as items are added to externs.c is a powerful
incentive to find a better design.

====
Mike Lutz	Rochester Institute of Technology, Rochester NY
UUCP:		{allegra,seismo}!rochester!ritcv!mjl
ARPA:		ritcv!mjl at Rochester.ARPA
-- 
Mike Lutz	Rochester Institute of Technology, Rochester NY
UUCP:		{allegra,seismo}!rochester!ritcv!mjl
ARPA:		ritcv!mjl at Rochester.ARPA



More information about the Comp.unix.wizards mailing list