Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!uunet!wuarchive!zaphod.mps.ohio-state.edu!swrinde!ucsd!pacbell.com!pacbell!att!dptg!mtunf!mtd From: mtd@mtunf.ATT.COM (Mario T DeFazio) Newsgroups: comp.sys.att Subject: Re: cc / cpp problem on 3B2 600G ( 3.2.2 ) -- too many defines Summary: There is another, possibly easier, solution: Break up your source modules Message-ID: <1241@mtunf.ATT.COM> Date: 8 Aug 90 17:04:13 GMT References: <8953@arctic.nprdc.arpa> <12157@attcan.UUCP> <1990Aug8.003316.12414@cfctech.cfc.com> Distribution: usa Organization: AT&T Bell Labs Lincroft NJ USA Lines: 57 In article <1990Aug8.003316.12414@cfctech.cfc.com>, kevin@cfctech.cfc.com (Kevin Darcy) writes: > In article <12157@attcan.UUCP> ram@attcan.UUCP (Richard Meesters) writes: > >In article <8953@arctic.nprdc.arpa>, apple@nprdc.navy.mil (Jim Apple) writes: > >> > >> I have run into a problem with cpp on a 600G ( 3.2.2 ) > >> "too many defines". I created some test files and it appears > >> that there is a hard limit on the number of defines. The size of > >> both the name and value affect the number of defines that I can > >> get. Simple names and a value of 1 gives me around 1980 defines > >> if I change the value to a string I'm down to 1200. > > Actually, the "hard limit" you're running into is *only* on total symbol name > space if you're getting "Too much defining." (which is what NetHack has > trouble with on a 3B2). Richard was running into the hard limit on *number* > of defines. Two slightly separate but interrelated problems. [...] > >The cause/symptom is as follows: > > > >Symptom: too many defines > > > >Cause: the number of #defines exceed the symbol table size: > > STATIC struct symtab stab[ symsiz ]; > > > >The fix is a new cpp which contains an increased symsiz to handle a larger > >number of defines. > > > >Unfortunately, unless you have source, you can't change it yourself. If the application is using curses, it doesn't surprise me that there are too many #define's. There are nearly 800 #define's in term.h and curses.h alone. (I think Jim had indicated that his application does do screen manipulation.) First, I hope you are using C Programming Language Utilities (CPLU) Version 4.2. The cpp in there is supposed to be able to handle up to 20,000 #define's. This alone might fix the problem. If it's still blowing out, another way of solving the problem is to isolate the curses function calls (and thus the inclusion of term.h and curses.h) in a separate C source module. You might have to do further module breakup (if your own header files are also large) until you get under the limit. Yes, I work for AT&T, but I'm not trying to make excuses for the hard limit in cpp. I just thought you could use a possibly quicker solution to your problem. And a solution over which you have much more control. Hope this helps, Mario T DeFazio AT&T Bell Labs AT&T Mail: mdefazio Lincroft, New Jersey UUCP: att!mtunf!mtd Internet: mtd@mtunf.att.com