Bug 500864 - Enable clang warning -Wlarge-by-value-copy. Value set to 256 for now r?froydnj
MozReview-Commit-ID: DnmY5H9WCGS
--- 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',