Bugfix/fix redundant compiler flags (#658)

* Improved GCC compiler flags in ARM, OS, and test builds. Removed redundant flags, and made them consistent across various builds.

* Fixed redundant redeclaration of various functions detected by change in compiler flags.

* Fixed string truncation warning in bip-init detected by change in compiler flags.

* Fixed some set-but-not-used variables by creating dummy functions instead of using macros.
This commit is contained in:
Steve Karg
2024-05-30 10:59:54 -05:00
committed by GitHub
parent 0cbf7414a4
commit 52f3f08cb1
20 changed files with 130 additions and 144 deletions
+7 -6
View File
@@ -145,13 +145,14 @@ CSTANDARD ?= -std=gnu89
#build for release (default) or debug
OPTIMIZATION ?= -Os
DEBUGGING ?=
WARNING_ALL := -Wall -Wextra -Wfloat-equal -Wconversion -Wparentheses
WARNING_ALL += -pedantic -Wunused-parameter -Wunused-variable -Wreturn-type
WARNING_ALL += -Wunused-function -Wreturn-type -Wunused-value
WARNING_ALL += -Wswitch-default -Wuninitialized -Winit-self
# enable all relevant warnings that find bugs
WARNING_ALL := -Wall -Wextra -Wfloat-equal -Wconversion
WARNING_ALL += -Wredundant-decls -Wswitch-default -pedantic
# don't warn about conversion, sign, compares, long long and attributes
# since they are common in embedded
WARNING_ALL += -Wno-sign-conversion -Wno-conversion -Wno-sign-compare
WARNING_ALL += -Wno-long-long -Wno-implicit-fallthrough -Wno-attributes
#WARNING_ALL += -Wredundant-decls
WARNING_ALL += -Wno-long-long -Wno-attributes
WARNING_ALL += -Wno-implicit-fallthrough
#WARNING_ALL += -Werror
WARNINGS ?= $(WARNING_ALL)
# dead code removal