[PATCH] New flag -Wframe-larger-than-

Mark Mitchell mark@codesourcery.com
Tue Feb 19 00:00:00 GMT 2008


Seongbae Park (박성배, 朴成培) wrote:
> I have no strong objection, but I'd prefer to keep - form
> as well if we go = route,
> since we've been using - form internally for a while already.

For FSF purposes, the "=" form is definitely better, and there's no 
reason to carry the "-" form forward.  So, the internal-use argument 
carries no weight; all of us who develop internal patches take this risk.

> +Warn whenever the size of a function frame is larger than @var{len} bytes.

I think the documentation here should be expanded.  As Richard says, 
this is only measuring the target-independent parts of the frame size. 
We need to be careful that we not encourage people to use this in RTOS 
as a way of determining exactly how many bytes to put on the stack.

So, something like:

"Warn whenever a function's stack frame requires more than @var{len} 
bytes.  The computation done to determine the stack frame size is 
approximate and not conservative.  The actual requirements may be 
somewhat greater than @var{len} even if you do not get a warning.  In 
addition, any space allocated via @code{alloca}, variable-length arrays, 
or related constructs is not included by the compiler when determining 
whether or not to issue a warning."

OK for 4.4 with that change.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list