diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-10-05 10:05:26 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-10-06 16:14:30 +0200 |
commit | 4134055f1855ea5293fa598fc3503e07a11d1d9d (patch) | |
tree | 6f85eb051902a371a59cc00590a89af2f1594c12 /gcc/rust/rust-lang.cc | |
parent | b4096017e3b9ca499b56988b67e05667a02ca202 (diff) | |
download | gcc-4134055f1855ea5293fa598fc3503e07a11d1d9d.zip gcc-4134055f1855ea5293fa598fc3503e07a11d1d9d.tar.gz gcc-4134055f1855ea5293fa598fc3503e07a11d1d9d.tar.bz2 |
lang.opt: Remove overzealous warning initialisation
pipeline: Add default warning initialisation
Option initialisations in lang.opt files are applied globally, so the
test suites of other frontend would fail when the rust language was
enabled.
This should be reversed once @tschwinge `LangInit` option is merged
Diffstat (limited to 'gcc/rust/rust-lang.cc')
-rw-r--r-- | gcc/rust/rust-lang.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/rust/rust-lang.cc b/gcc/rust/rust-lang.cc index c9af790..72f3dc0 100644 --- a/gcc/rust/rust-lang.cc +++ b/gcc/rust/rust-lang.cc @@ -162,6 +162,13 @@ grs_langhook_init_options_struct (struct gcc_options *opts) * builtins */ opts->x_flag_wrapv = 1; + /* We need to warn on unused variables by default */ + opts->x_warn_unused_variable = 1; + /* For const variables too */ + opts->x_warn_unused_const_variable = 1; + /* And finally unused result for #[must_use] */ + opts->x_warn_unused_result = 1; + // nothing yet - used by frontends to change specific options for the language Rust::Session::get_instance ().init_options (); } |