Getting the "ISO C90 forbids variable size array" warning in the gcc compiler when compiling C90 code

I am compiling my C90 c code in gcc. I get a warning ISO C90 forbids variable-size arraywhen I advertise as

int symbols[nc];

Where nc is an integer whose value is read from the input file. The values ​​in the input files are changing, so I can’t keep a constant value. How can I get rid of it? Is it really necessary to eliminate this warning or can we just ignore it?

Thanks in advance.

+3
source share
1 answer

You get this warning because the C90 does not support variable length arrays .

gcc C99 ( vla), -std = c99 std = gnu99, .

, C90, . .

+5

Source: https://habr.com/ru/post/1787315/


All Articles