build: Warn about VLA usage

Using consts for array sizes is a C++-ism, and in GCC in C-mode it won't fold literal constants, and will instead prefer to make a VLA.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
Joshua Ashton 2021-03-04 15:37:26 +00:00
parent 38bb845800
commit 129b464c24
No known key found for this signature in database
GPG Key ID: C85A08669126BE8D
1 changed files with 3 additions and 0 deletions

View File

@ -97,6 +97,9 @@ endif
add_project_arguments(vkd3d_compiler.get_supported_arguments([
'-fvisibility=hidden',
# For some reason, the use of VLAs isn't in all+extra+pedantic
# We don't want to use these accidentally from consts...
'-Wvla',
'-Wno-format',
'-Wno-missing-field-initializers',
'-Wno-unused-parameter',