diff --git a/src/_premake_init.lua b/src/_premake_init.lua index 7a95b8da..45b45c99 100644 --- a/src/_premake_init.lua +++ b/src/_premake_init.lua @@ -762,6 +762,7 @@ "gnu90", "gnu99", "gnu11", + "gnu17" } } diff --git a/src/tools/gcc.lua b/src/tools/gcc.lua index fef1c142..438a72e8 100644 --- a/src/tools/gcc.lua +++ b/src/tools/gcc.lua @@ -136,10 +136,12 @@ ["C90"] = "-std=c90", ["C99"] = "-std=c99", ["C11"] = "-std=c11", + ["C17"] = "-std=c17", ["gnu89"] = "-std=gnu89", ["gnu90"] = "-std=gnu90", ["gnu99"] = "-std=gnu99", ["gnu11"] = "-std=gnu11", + ["gnu17"] = "-std=gnu17" } } diff --git a/tests/tools/test_gcc.lua b/tests/tools/test_gcc.lua index ade14436..fb543506 100644 --- a/tests/tools/test_gcc.lua +++ b/tests/tools/test_gcc.lua @@ -807,6 +807,13 @@ test.contains({ }, gcc.getcxxflags(cfg)) end + function suite.cflags_onC17() + cdialect "C17" + prepare() + test.contains({ "-std=c17" }, gcc.getcflags(cfg)) + test.contains({ }, gcc.getcxxflags(cfg)) + end + function suite.cflags_ongnu89() cdialect "gnu89" prepare() @@ -835,6 +842,13 @@ test.contains({ }, gcc.getcxxflags(cfg)) end + function suite.cflags_ongnu17() + cdialect "gnu17" + prepare() + test.contains({ "-std=gnu17" }, gcc.getcflags(cfg)) + test.contains({ }, gcc.getcxxflags(cfg)) + end + function suite.cxxflags_onCppDefault() cppdialect "Default" prepare() diff --git a/website/docs/cdialect.md b/website/docs/cdialect.md index 1687a99a..8a92002d 100644 --- a/website/docs/cdialect.md +++ b/website/docs/cdialect.md @@ -18,6 +18,7 @@ cdialect "value" * `gnu90`: GNU dialect of ISO C90 * `gnu99`: GNU dialect of ISO C99 * `gnu11`: GNU dialect of ISO C11 +* `gnu17`: GNU dialect of ISO C17 ### Applies To ###