Kacheong Poon wrote:
> I have a question about lint warning on the following code.
>
> int foo(void)
> {
> ...
> }
>
> int bar(void)
> {
> int a[foo()];
> ...
> }
>
> Lint complains that the return value of foo() is ignored.
> Isn't the above a valid way to use the variable-length
> array feature (assuming it will not cause stack overflow)?
> Or is it an issue in lint? The lint is
>
> lint: Sun C 5.9 SunOS_i386 Patch 124868-10 2009/04/30
>
> Thanks.
>
Stack overflow issue aside, yes it is a valid way to declare a variable
length array. There is an open bug report against lint for this issue.
--Dave