cmake: compiler: add double promotion warning
Too many times, code is pushed that includes floats that really becomes doubles and C implicit promotion rules will want to make floats into doubles very easily. As zephyr primarily targets low-end process that may not have a double precision floating point unit, enable this flag globally for now. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
This commit is contained in:
parent
432f4a0b9a
commit
018dbcfd66
3 changed files with 9 additions and 0 deletions
|
@ -33,6 +33,9 @@ set_compiler_property(PROPERTY warning_base
|
|||
-Wno-typedef-redefinition
|
||||
)
|
||||
|
||||
# C implicit promotion rules will want to make floats into doubles very easily
|
||||
check_set_compiler_property(APPEND PROPERTY warning_base -Wdouble-promotion)
|
||||
|
||||
check_set_compiler_property(APPEND PROPERTY warning_base -Wno-pointer-sign)
|
||||
|
||||
# Prohibit void pointer arithmetic. Illegal in C99
|
||||
|
|
|
@ -45,6 +45,9 @@ check_set_compiler_property(PROPERTY warning_base
|
|||
-Wno-deprecated-non-prototype
|
||||
)
|
||||
|
||||
# C implicit promotion rules will want to make floats into doubles very easily
|
||||
check_set_compiler_property(APPEND PROPERTY warning_base -Wdouble-promotion)
|
||||
|
||||
check_set_compiler_property(APPEND PROPERTY warning_base -Wno-pointer-sign)
|
||||
|
||||
# Prohibit void pointer arithmetic. Illegal in C99
|
||||
|
|
|
@ -32,6 +32,9 @@ check_set_compiler_property(PROPERTY warning_base
|
|||
"SHELL:-Wformat -Wno-format-zero-length"
|
||||
)
|
||||
|
||||
# C implicit promotion rules will want to make floats into doubles very easily
|
||||
check_set_compiler_property(APPEND PROPERTY warning_base -Wdouble-promotion)
|
||||
|
||||
check_set_compiler_property(APPEND PROPERTY warning_base -Wno-pointer-sign)
|
||||
|
||||
# Prohibit void pointer arithmetic. Illegal in C99
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue