https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f424d524882efbd06e85aa...
commit f424d524882efbd06e85aad1e36fbd7aa8bb60ce Author: Jérôme Gardou jerome.gardou@reactos.org AuthorDate: Mon Nov 9 13:28:34 2020 +0100 Commit: Jérôme Gardou zefklop@users.noreply.github.com CommitDate: Mon Nov 16 16:58:10 2020 +0100
[EXT2FS] Use GNU89 standard when using CLang --- drivers/filesystems/ext2/CMakeLists.txt | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/drivers/filesystems/ext2/CMakeLists.txt b/drivers/filesystems/ext2/CMakeLists.txt index 38851437730..dbd8cc84925 100644 --- a/drivers/filesystems/ext2/CMakeLists.txt +++ b/drivers/filesystems/ext2/CMakeLists.txt @@ -92,23 +92,32 @@ if(USE_CLANG_CL) set_property(SOURCE src/create.c src/fileinfo.c src/memory.c src/read.c APPEND_STRING PROPERTY COMPILE_FLAGS " /fallback") endif()
-if(MSVC AND (NOT USE_CLANG_CL)) +if(MSVC) # Disable warnings: "unreferenced local variable", "initialized, but not used variable", "benign include" - remove_target_compile_option(ext2fs "/we4101") - remove_target_compile_option(ext2fs "/we4189") - target_compile_options(ext2fs PRIVATE /wd4189 /wd4142 /wd4101) + if (NOT CLANG) + remove_target_compile_option(ext2fs "/we4101") + remove_target_compile_option(ext2fs "/we4189") + target_compile_options(ext2fs PRIVATE /wd4189 /wd4142 /wd4101) + endif() else() - target_compile_options(ext2fs PRIVATE -Wno-pointer-sign -Wno-unused-function) - target_compile_options(ext2fs PRIVATE -Wno-unused-variable -Wno-missing-braces) - if(USE_CLANG_CL) - target_compile_options(ext2fs PRIVATE -Wno-unused-value -Wno-parentheses-equality) - target_compile_options(ext2fs PRIVATE -Wno-incompatible-pointer-types-discards-qualifiers) - target_compile_options(ext2fs PRIVATE "-Wno-#pragma-messages;-Wno-cast-calling-convention") - else() + target_compile_options(ext2fs PRIVATE + -Wno-pointer-sign -Wno-unused-function + -Wno-unused-variable -Wno-missing-braces) + if (NOT CLANG) target_compile_options(ext2fs PRIVATE -Wno-unused-but-set-variable) endif() endif()
+if(CLANG) + target_compile_options(ext2fs PRIVATE + -Wno-unused-value -Wno-parentheses-equality + -Wno-incompatible-pointer-types-discards-qualifiers + "-Wno-#pragma-messages;-Wno-cast-calling-convention") + if (GCC) + target_compile_options(ext2fs PRIVATE -std=gnu89) + endif() +endif() + target_link_libraries(ext2fs memcmp ${PSEH_LIB}) add_definitions(-D__KERNEL__ -D_CRT_NO_POSIX_ERROR_CODES) set_module_type(ext2fs kernelmodedriver)