[PATCH] D125142: [clang][auto-init] Remove -enable flag for "zero" mode
Nick Desaulniers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 9 10:02:04 PDT 2022
nickdesaulniers accepted this revision.
nickdesaulniers added a comment.
This revision is now accepted and ready to land.
It looks like clang still produces meaningful diagnostics from `-Wuninitialized` and `-Wsometimes-uninitialized` even with `-ftrivial-auto-var-init=zero`. Same for `[clang-diagnostic-sometimes-uninitialized]`, `[clang-analyzer-core.uninitialized.UndefReturn]`, and `[clang-diagnostic-uninitialized]`.
Looks like GCC now even does a better job with `-Wuninitialized` on
void init (int *x) {}
int x (int z) {
int y;
init(&y);
return y;
}
================
Comment at: clang/test/Driver/clang_f_opts.c:573
+// RUN: %clang -### -S -ftrivial-auto-var-init=zero %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-ZERO %s
+// RUN: %clang -### -S -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-ZERO-UNUSED %s
// CHECK-TRIVIAL-UNINIT-NOT: hasn't been enabled
----------------
consider breaking long run lines into 2 with `\`. Example:
```
// RUN: %clang -### ... -S \
// RUN: -ftrivial-auto-var-init=zero ...
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125142/new/
https://reviews.llvm.org/D125142
More information about the cfe-commits
mailing list