Skip to content

Commit

Permalink
Tools: waf: add various conversion warning compiler options
Browse files Browse the repository at this point in the history
suggested by @patrickelectric
  • Loading branch information
peterbarker authored and tridge committed Apr 29, 2019
1 parent 02d976f commit 1dd5c33
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Tools/ardupilotwaf/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,20 @@ def configure_env(self, cfg, env):
'-Werror=inconsistent-missing-override',
'-Werror=overloaded-virtual',

# catch conversion issues:
'-Werror=bitfield-enum-conversion',
'-Werror=bool-conversion',
'-Werror=constant-conversion',
'-Werror=enum-conversion',
'-Werror=int-conversion',
'-Werror=literal-conversion',
'-Werror=non-literal-null-conversion',
'-Werror=null-conversion',
'-Werror=objc-literal-conversion',
# '-Werror=shorten-64-to-32', # ARRAY_SIZE() creates this all over the place as the caller typically takes a uint32_t not a size_t
'-Werror=string-conversion',
# '-Werror=sign-conversion', # can't use as we assign into AP_Int8 from uint8_ts

'-Wno-gnu-designator',
'-Wno-mismatched-tags',
'-Wno-gnu-variable-sized-type-not-at-end',
Expand Down Expand Up @@ -318,7 +332,7 @@ def configure_env(self, cfg, env):
)

env.CXXFLAGS += [
'-Werror=float-equal'
'-Werror=float-equal',
]

if not cfg.env.DEBUG:
Expand Down

0 comments on commit 1dd5c33

Please sign in to comment.