Path: utzoo!news-server.csri.toronto.edu!rutgers!mcnc!uvaarpa!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: header file duplicate definitions advice sought Message-ID: <15423@smoke.brl.mil> Date: 10 Mar 91 22:14:38 GMT References: Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 17 In article cracraft@pogo.ai.mit.edu (Stuart Cracraft) writes: >How can you eliminate redefined errors in C when you have several thousand >"#define"'s defined in both *.h and *.c files(about 2000 files combined)? (This is more appropriate for comp.lang.c.) The basic problem you have is that C supports only a few "flat" name spaces. Thus, if one wishes to properly package related sets of identifiers without conflict among multiple packages, one has to devise his own packaging scheme. For BRL's MUVES project we reserved the first two characters of "visible" (extern, macro, and file) identifiers to denote the specific package, and maintained a central registry of package names. Of course each package had a header that defined its visible interface. There is NO satisfactory way to handle a situation such as you describe, where insufficient care was taken in designing the interfaces.