From 1fb47422e9feb6f6736620fe8adac6be421c4ca1 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 16 May 2024 14:23:12 +0100 Subject: [PATCH] build: Use C89 for the standard version check The '90' version is for ISO C90, but Meson does not understand it. As far as GCC and Clang are concerned, `-std=c89` is exactly the same as `-std=c90`. As of VS 2017, MSVC supports `/std:c11` as the minimum version of the C standard, with C89 (plus Microsoft extensions) being the default. See: - GCC: https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/C-Dialect-Options.html - MSVC: https://learn.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=msvc-170#c-standards-support-1 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 3dc0a79ce..7b9d2bcd5 100644 --- a/meson.build +++ b/meson.build @@ -14,7 +14,7 @@ fs = import('fs') cc = meson.get_compiler('c') c_standards = {} -foreach std : ['90', '99', '11', '17'] +foreach std : ['89', '99', '11', '17'] arg = (cc.get_id() == 'msvc' ? '/std:' : '-std=') + 'c' + std if cc.has_argument(arg) c_standards += { std: arg }