-
Notifications
You must be signed in to change notification settings - Fork 704
Turn warnings into errors in CI #4397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Turn warnings into errors in CI #4397
Conversation
lum1n0us
commented
Jun 20, 2025
- Apply global warnings in config_common.cmake instead of maintaining them in separate files.
- Enable errors during CI when building iwasm and wamrc
f5a4210
to
b1a3ca5
Compare
- Apply global warnings in config_common.cmake instead of maintaining them in separate files. - Enable errors during CI when building iwasm and wamrc. - Since GCC and Clang are the default compilers on Ubuntu and macOS, enabling `-Werror` on both platforms can be treated as checking with different compilers.
f553bd8
to
c3cb9e0
Compare
# Remove the extra spaces for better make log | ||
string (REGEX REPLACE " *" " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) | ||
endif() | ||
|
||
# global additional warnings. Keep those options consistent with config_common.cmake. | ||
if (MSVC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels like a duplication of config_common.cmake - would it make sense to create warnings.cmake file and move the common code there, so it can be included when needed?
# | ||
# -fpermissive causes warnings like "-fpermissive is valid for C++/ObjC++ but not for C" | ||
# | ||
# _Static_assert and _Alignof requires c11 or later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this c11 comment intended to be here? why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reminding me. I am inclined to start a discussion here, as we are using _Static_assert
and _Alignof
(and/or atomic), primarily in WASI. Do we need to designate C11 as our standard, or should we continue using a lower version, like C99, for cross-platform compatibility?
code in wamr-compiler/CMakeLists.txt
if (WAMR_BUILD_LIBC_WASI EQUAL 1)
# Enable _Static_assert
set (CMAKE_C_STANDARD 11)
if (MSVC)
add_compile_options(/experimental:c11atomics)
endif()
else()
set (CMAKE_C_STANDARD 99)
endif()