I am dynamically calculating the size of the array. Sort of:
void foo(size_t limit)
{
char buffer[limit * 14 + 1];
}
But only the GCC compiler says:
error: ISO C90 forbids variable length array ‘buffer’
search on SO I found this answer :
C99 §6.7.5.2:
If size is an expression that is not an integer constant expression ...... every time it is evaluated, it must have a value greater than zero.
So, I re-declared the variable of type size limit:
void foo(const size_t limit)
But he continues to warn me. Is this a GCC bug?
source
share