Skip to content

Commit

Permalink
Merge pull request #2206 from skliper/fix2205-strict_cast_align
Browse files Browse the repository at this point in the history
Hotfix #2205, apply strict cast-align to native builds only
  • Loading branch information
dzbaker committed Nov 28, 2022
2 parents 1e83dbd + b84dfbb commit f724dbc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion cmake/sample_defs/arch_build_custom.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ add_compile_options(
-Wstrict-prototypes # Warn about missing prototypes
-Wwrite-strings # Warn if not treating string literals as "const"
-Wpointer-arith # Warn about suspicious pointer operations
-Wcast-align=strict # Warn about casts that increase alignment requirements
-Werror # Treat warnings as errors (code should be clean)
-Wno-format-truncation # Inhibit printf-style format truncation warnings
-Wno-stringop-truncation # Inhibit string operation truncation warnings
Expand Down
11 changes: 11 additions & 0 deletions cmake/sample_defs/arch_build_custom_native.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# Example arch_build_custom.cmake
# -------------------------------
#
# On native builds only, add strict cast alignment warnings
# This requires a newer version of gcc
#
add_compile_options(
-Wcast-align=strict # Warn about casts that increase alignment requirements
)

0 comments on commit f724dbc

Please sign in to comment.