Joerg Schilling wrote:

>> int foo(void)
>> {
>>   ...
>> }
>>
>> int bar(void)
>> {
>>     int a[foo()];
>>     ...
>> }


> Variable length arrays do not help to avoid stack overflows.
> VLAs should not be used if you don't know at compile time that the
> actual size will always be within reasonable bounds.


VLA is not used to avoid stack overflow.  The above
code serves as an example which lint complains.


> Regarding the principle correctness of the code, I believe that this should 
> work.


I guess it is a bug in lint?  Is there a directive
I can use to suppress lint warning in this case?

Thanks.


-- 

                                                K. Poon.
                                                kacheong.poon at sun.com

Reply via email to