Hi Gabe,

You could try doing this:

put the following #pragma into your prefix file (or a common header) ...

#pragma stack_cleanup on

The compiler will clean up the stack after each call instead of at the end
of each basic block, thus reducing stack usage.

from "CW Mac 68K Notes 2.0.1.txt" --

   * support for #pragma stack_cleanup on | off | reset (default: off)

   Selecting this option will disable the deferred stack cleanup after
   function calls. Usually this is not what you want because it
   generates more and slower code.

HTH,
JK Lam
Metrowerks Technical Support


-----Original Message-----
From: Gabe Dalbec <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>; [EMAIL PROTECTED]
<[EMAIL PROTECTED]>; [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, March 08, 1999 5:55 PM
Subject: Stack Usage


>
>I am porting my application from gcc to CodeWarrior, and am having some
problems
>with it crashing.  It seems to crash for no reason that I can see (though
always
>in the exact same place).  I suspect it is stack space related.   This code
runs
>just fine if I compile it under gcc.  I recall hearing that there was an
option
>in CodeWarror to determine how the stack is cleaned up which may save some
stack
>space, but I can not find that option, or mention of it on Metrowerks web
site.
>
>Do you know what this options is, or am I remembering wrong?
>
>What other advice do you have for debugging potential stack corruption
errors?
>
>Thanks,
>-Gabe
>Palm Creations
>
>
>

Reply via email to