[REACTOS] Raise C standard to gnu99

And remove -Wdeclaration-after-statement
This commit is contained in:
Victor Perevertkin 2020-04-25 03:10:27 +03:00
parent a0283ecea3
commit 95483b42ea
No known key found for this signature in database
GPG Key ID: C750B7222E9C7830
2 changed files with 3 additions and 23 deletions

View File

@ -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()

View File

@ -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 */ \
}