Enforce pure C99 build.

Building with -std=c99 is not sufficient to enforce a pure C99 build as it still allows GNU extensions which don't conflict with C99 to be used. Add -pedantic to the build options to ensure that the codebase is only using C99 constructs and the build will fail whenever any compiler extension is used. This helps to ensure that JerryScript remains portable and can be built with any C99-compatible C compiler.

Removing -Wpedantic, as any warnings of that type will already trigger an error when building with -pedantic.

JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
This commit is contained in:
Tilmann Scheller
2016-06-21 08:18:24 +02:00
parent c0665da299
commit 04ab949126
+2 -2
View File
@@ -263,7 +263,7 @@ project (Jerry C ASM)
endforeach()
endmacro()
add_jerry_compile_warnings(all extra format-nonliteral init-self conversion sign-conversion format-security missing-declarations pedantic)
add_jerry_compile_warnings(all extra format-nonliteral init-self conversion sign-conversion format-security missing-declarations)
add_jerry_compile_flags(-Wno-stack-protector -Wno-attributes)
if(CMAKE_COMPILER_IS_GNUCC)
if(${USE_JERRY_LIBC})
@@ -286,7 +286,7 @@ project (Jerry C ASM)
endif()
# C
set(C_FLAGS_JERRY "-std=c99")
set(C_FLAGS_JERRY "-std=c99 -pedantic")
# Platform-specific
# MCU