https://git.reactos.org/?p=reactos.git;a=commitdiff;h=95483b42ea1b45dc11620…
commit 95483b42ea1b45dc11620ce139b8456ee9cdda76
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Sat Apr 25 03:10:27 2020 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Mon May 4 21:44:55 2020 +0300
[REACTOS] Raise C standard to gnu99
And remove -Wdeclaration-after-statement
---
sdk/cmake/gcc.cmake | 7 +++----
sdk/include/reactos/libs/pseh/pseh3.h | 19 -------------------
2 files changed, 3 insertions(+), 23 deletions(-)
diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake
index 1a3be9a4ab4..616d4578f47 100644
--- a/sdk/cmake/gcc.cmake
+++ b/sdk/cmake/gcc.cmake
@@ -52,7 +52,7 @@ if(NOT GCC_VERSION VERSION_LESS 4.8)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
- add_compile_flags_language("-std=gnu89 -Wno-microsoft" "C")
+ add_compile_flags_language("-std=gnu99 -Wno-microsoft" "C")
set(CMAKE_LINK_DEF_FILE_FLAG "")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
set(CMAKE_LINK_LIBRARY_SUFFIX "")
@@ -70,7 +70,6 @@ if(DBG)
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_flags_language("-Wold-style-declaration" "C")
endif()
- add_compile_flags_language("-Wdeclaration-after-statement" "C")
endif()
add_compile_flags_language("-fno-rtti -fno-exceptions" "CXX")
@@ -351,8 +350,8 @@ endif()
function(fixup_load_config _target)
get_target_property(PEFIXUP native-pefixup IMPORTED_LOCATION_NOCONFIG)
- add_custom_command(TARGET ${_target} POST_BUILD
- COMMAND "${PEFIXUP}"
+ add_custom_command(TARGET ${_target} POST_BUILD
+ COMMAND "${PEFIXUP}"
"$<TARGET_FILE:${_target}>"
COMMENT "Patching in LOAD_CONFIG")
endfunction()
diff --git a/sdk/include/reactos/libs/pseh/pseh3.h
b/sdk/include/reactos/libs/pseh/pseh3.h
index 6f9732ed728..05bb3de3b87 100644
--- a/sdk/include/reactos/libs/pseh/pseh3.h
+++ b/sdk/include/reactos/libs/pseh/pseh3.h
@@ -16,12 +16,6 @@
extern "C" {
#endif
-#ifdef __cplusplus
-#define PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT
-#else
-#define PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT _Pragma("GCC
diagnostic ignored \"-Wdeclaration-after-statement\"")
-#endif
-
/* CLANG must safe non-volatiles, because it uses a return-twice algorithm */
#if defined(__clang__) && !defined(_SEH3$_FRAME_ALL_NONVOLATILES)
#define _SEH3$_FRAME_ALL_NONVOLATILES 1
@@ -358,9 +352,6 @@ _Pragma("GCC diagnostic pop") \
(void)&&_SEH3$_l_OnException; \
(void)&&_SEH3$_l_BeforeFilterOrFinally; \
(void)&&_SEH3$_l_FilterOrFinally; \
-\
-_Pragma("GCC diagnostic push") \
-PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT \
\
/* Count the try level. Outside of any __try, _SEH3$_TryLevel is 0 */ \
enum { \
@@ -373,8 +364,6 @@ PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT \
\
/* Allocate a registration frame */ \
volatile SEH3$_REGISTRATION_FRAME _SEH3$_AUTO_CLEANUP _SEH3$_TrylevelFrame; \
-\
-_Pragma("GCC diagnostic pop") \
\
goto _SEH3$_l_BeforeTry; \
/* Silence warning */ goto _SEH3$_l_AfterTry; \
@@ -390,9 +379,6 @@ _Pragma("GCC diagnostic pop") \
\
_SEH3$_l_BeforeTry: (void)0; \
_SEH3$_ASM_GOTO(_SEH3$_l_OnException); \
-\
-_Pragma("GCC diagnostic push") \
-PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT \
\
/* Forward declaration of the filter function */ \
_SEH3$_DECLARE_FILTER_FUNC(_SEH3$_FilterFunction); \
@@ -440,9 +426,6 @@ PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT \
\
_SEH3$_l_BeforeTry: (void)0; \
_SEH3$_ASM_GOTO(_SEH3$_l_OnException); \
-\
-_Pragma("GCC diagnostic push") \
-PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT \
\
/* Forward declaration of the finally function */ \
_SEH3$_DECLARE_FILTER_FUNC(_SEH3$_FinallyFunction); \
@@ -479,8 +462,6 @@ PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT \
\
/* Implementation of the auto cleanup function */ \
_SEH3$_DEFINE_CLEANUP_FUNC(_SEH3$_AutoCleanup); \
-\
-_Pragma("GCC diagnostic pop") \
\
/* Close the outer scope */ \
}