>> GCC does warn if returning a pointer to a local variable (stack memory).
>> But there are alot of more cases where GCC could possibly warn,
>> eg. when references are made to local variables or stack memory.
>>
>> See this attached example code.
>> GCC warn
"sa...@hederstierna.com" writes:
> GCC does warn if returning a pointer to a local variable (stack memory).
> But there are alot of more cases where GCC could possibly warn,
> eg. when references are made to local variables or stack memory.
>
> See this attached exam
Hi
GCC does warn if returning a pointer to a local variable (stack memory).
But there are alot of more cases where GCC could possibly warn,
eg. when references are made to local variables or stack memory.
See this attached example code.
GCC warns for first case, but not the others.
I think all
On Oct 21, 2005, at 8:05 AM, Ivan Novick wrote:
With the sun compiler, the declared buffer is pushed onto the stack
upon
entry into function foo and not only when it goes into scope.
Yup.
Do you know if gcc will use the stack for the buffer if it never
goes into scope?
Yes, it usually wi
Hi,
With the sun compiler, the declared buffer is pushed onto the stack upon
entry into function foo and not only when it goes into scope.
Do you know if gcc will use the stack for the buffer if it never goes into
scope?
function foo()
{
if ( debug > 0 )
{
char debug_buffer[4096