On 29/02/2024 08.03, Paz Offer wrote:
Hi,

I am trying to build my code with QEMU and getting compilation error according to the /ISO C90 /standard:

      const size_t buf_size = 31;
      char buffer[buf_size + 1];

      error: ISO C90 forbids array ‘buffer’ whose size can’t be evaluated [-Werror=vla]

I noticed that the code builds with '-std=gnu11', which is newer then C90, so this is not clear to me why I get this error.
Where is the correct place to specify the language version for this?

The "ISO C90" part of the error message is quite misleading here. It's rather that we explicitly enabled -Werror=vla in our codebase recently:

 https://gitlab.com/qemu-project/qemu/-/commit/64c1a5443528ac09d8cd50f365d6

See the commit description there for the rationale.

 Thomas


Reply via email to