Bug 500864 - Enable clang warning -Wlarge-by-value-copy. Value set to 256 for now r?froydnj draft
authorSylvestre Ledru <sledru@mozilla.com>
Tue, 17 Jul 2018 17:12:07 +0200
changeset 819289 ee457c74a5b9126ec013890d9de6af459170c573
parent 817076 3aca103e49150145dbff910be15e7886b7c4495a
push id116496
push userbmo:sledru@mozilla.com
push dateTue, 17 Jul 2018 15:12:53 +0000
reviewersfroydnj
bugs500864
milestone63.0a1
Bug 500864 - Enable clang warning -Wlarge-by-value-copy. Value set to 256 for now r?froydnj MozReview-Commit-ID: DnmY5H9WCGS
build/moz.configure/warnings.configure
--- a/build/moz.configure/warnings.configure
+++ b/build/moz.configure/warnings.configure
@@ -105,16 +105,20 @@ check_and_add_gcc_warning('-Wno-error=mu
 # Disable the -Werror for return-std-move because of a false positive
 # on nsTAutoStringN: https://bugs.llvm.org/show_bug.cgi?id=37249
 check_and_add_gcc_warning('-Wno-error=return-std-move')
 
 # Disable the -Werror for -Wclass-memaccess as we have a long
 # tail of issues to fix
 check_and_add_gcc_warning('-Wno-error=class-memaccess')
 
+# Check if the argument should not be pass by reference instead of copy
+# The value has been chosen arbitrary.
+check_and_add_gcc_warning('-Wlarge-by-value-copy=256')
+
 # catches format/argument mismatches with printf
 c_format_warning, cxx_format_warning = check_and_add_gcc_warning(
     '-Wformat', when=depends(target)(lambda t: t.kernel != 'WINNT'))
 
 # Add compile-time warnings for unprotected functions and format functions
 # that represent possible security problems. Enable this only when -Wformat
 # is enabled, otherwise it is an error
 check_and_add_gcc_warning('-Wformat-security',