[comp.sys.mac] LSC Compiler Message -- Code Overflow

lsn@macbeth.cs.duke.edu (Lars S. Nyland) (05/02/89)

Recently, a program came across comp.sources.misc that would tell you
the characteristics of your C compiler (config was its name).  I ran
it on the sun 3&4 and it worked fine.  Then I ran it with THINK C.

The error message from think C was "code overflow".

Does anyone have any hints about how to fix this problem?
Does it mean the file is too long?
The function is too long?
The nesting is too deep?

Thanks for any help.

siegel@endor.harvard.edu (Rich Siegel) (05/03/89)

In article <14373@duke.cs.duke.edu> lsn@macbeth.cs.duke.edu (Lars S. Nyland) writes:
>
>Recently, a program came across comp.sources.misc that would tell you
>the characteristics of your C compiler (config was its name).  I ran
>it on the sun 3&4 and it worked fine.  Then I ran it with THINK C.
>
>The error message from think C was "code overflow".
>

	A single source module can't cause more than 32K of code to be
generated. The workaround is to split your code up.

		--Rich



~~~~~~~~~~~~~~~
 Rich Siegel
 Staff Software Developer
 Symantec Corporation, Language Products Group
 Internet: siegel@endor.harvard.edu
 UUCP: ..harvard!endor!siegel

 "She told me to make myself comfortable, so I pulled down my pants
 and sat in the pudding." -Emo Phillips
~~~~~~~~~~~~~~~

trebor@biar.UUCP (Robert J Woodhead) (05/03/89)

In article <14373@duke.cs.duke.edu> lsn@macbeth.cs.duke.edu (Lars S. Nyland) writes:
>The error message from think C was "code overflow".

Code segments are limited to 32k bytes each.  If my hunch is correct, this
is your problem.  Divide up your program into several segments; check the
THINK C manual on how to do this.

-- 
Robert J Woodhead, Biar Games, Inc.  !uunet!biar!trebor | trebor@biar.UUCP
"The lamb will lie down with the lion, but the lamb won't get much sleep."
     -- Woody Allen.