Bug 1356843 - Enable -Wcomma clang warnings. r=glandium

Warn about possible misuse of the comma operator such as between two statements or to call a function for side effects within an expression. Only enable these -Wcomma warnings for C++ code because there are almost two hundred -Wcomma warnings in third-party C libraries. I reviewed the C warnings and confirmed none of them were latent bugs. We won't fix these libraries' warnings so they are just noise.

MozReview-Commit-ID: 1JXJumg6DsJ

--HG--
extra : rebase_source : c48189653361aa84edd3004188315cd73aefa9b5
extra : amend_source : 30be5afeb03eff26d59ccde57c0eb547b743c304
This commit is contained in:
Chris Peterson 2017-04-08 12:36:48 -07:00
parent eea325c79d
commit 1345634886

View File

@ -61,6 +61,9 @@ check_and_add_gcc_warning('-Wc++14-compat', cxx_compiler)
check_and_add_gcc_warning('-Wc++14-compat-pedantic', cxx_compiler)
check_and_add_gcc_warning('-Wc++1z-compat', cxx_compiler)
# catches possible misuse of the comma operator
check_and_add_gcc_warning('-Wcomma', cxx_compiler)
# catches unintentional switch case fallthroughs
check_and_add_gcc_warning('-Wimplicit-fallthrough', cxx_compiler)