File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,28 @@ else ()
16
16
#
17
17
# -fpermissive causes warnings like "-fpermissive is valid for C++/ObjC++ but not for C"
18
18
#
19
+ # Reference:
20
+ # - gcc-4.8 https://gcc.gnu.org/onlinedocs/gcc-4.8.4/gcc/Warning-Options.html
21
+ # - gcc-11.5 https://gcc.gnu.org/onlinedocs/gcc-11.5.0/gcc/Warning-Options.html
19
22
add_compile_options (
20
- $<$<COMPILE_LANGUAGE:C>:-Wincompatible-pointer-types>
21
23
$<$<COMPILE_LANGUAGE:C>:-Wimplicit-function-declaration>
22
24
)
25
+
26
+ # https://gcc.gnu.org/gcc-5/changes.html introduces incompatible-pointer-types
27
+ # https://releases.llvm.org/7.0.0/tools/clang/docs/DiagnosticsReference.html#wincompatible-pointer-types
28
+ # is the earliest version that supports this option I can found.
29
+ # Assume AppClang versioning is compatible with Clang.
30
+ if ((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "5.1" )
31
+ OR (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0.0" )
32
+ OR (CMAKE_C_COMPILER_ID STREQUAL "AppClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0.0" ))
33
+ add_compile_options ($<$<COMPILE_LANGUAGE:C>:-Wincompatible-pointer-types>)
34
+ endif ()
35
+
36
+ # options benefit embedded system.
23
37
add_compile_options (
24
38
-Wdouble-promotion
25
39
)
40
+
26
41
# waivers
27
42
add_compile_options (
28
43
-Wno-unused
Original file line number Diff line number Diff line change @@ -7495,7 +7495,7 @@ wasm_loader_unload(WASMModule *module)
7495
7495
#endif
7496
7496
#endif
7497
7497
#if WASM_ENABLE_BRANCH_HINTS != 0
7498
- for (size_t i = 0; i < module->function_count; i++) {
7498
+ for (i = 0; i < module->function_count; i++) {
7499
7499
// be carefull when adding more hints. This only works as long as
7500
7500
// the hint structs have been allocated all at once as an array.
7501
7501
// With only branch-hints at the moment, this is the case.
You can’t perform that action at this time.
0 commit comments