From: Jan Janssen Date: Sat, 7 May 2022 09:31:26 +0000 (+0200) Subject: meson: Compile with -ftrivial-auto-var-init=zero in release mode X-Git-Tag: v252-rc1~872^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a4e392760cb582c6d18f1cf58c7ca234e5b815c;p=thirdparty%2Fsystemd.git meson: Compile with -ftrivial-auto-var-init=zero in release mode --- diff --git a/meson.build b/meson.build index e43dcf7d509..b36e02797d4 100644 --- a/meson.build +++ b/meson.build @@ -413,6 +413,13 @@ if cc.get_id() == 'clang' ] endif +if get_option('mode') == 'release' + # We could enable 'pattern' for developer mode, but that can interfere with + # valgrind and sanitizer builds. Also, clang does not zero-initialize unions, + # breaking some of our code (https://reviews.llvm.org/D68115). + possible_common_cc_flags += '-ftrivial-auto-var-init=zero' +endif + possible_cc_flags = possible_common_cc_flags + [ '-Werror=missing-declarations', '-Werror=missing-prototypes',