cc / cpp problem on 3B2 600G ( 3.2.2 ) -- too many defines

Mario T DeFazio mtd at mtunf.ATT.COM
Thu Aug 9 03:04:13 AEST 1990


In article <1990Aug8.003316.12414 at cfctech.cfc.com>, kevin at cfctech.cfc.com (Kevin Darcy) writes:
> In article <12157 at attcan.UUCP> ram at attcan.UUCP (Richard Meesters) writes:
> >In article <8953 at arctic.nprdc.arpa>, apple at 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 at mtunf.att.com



More information about the Comp.sys.att mailing list