From 5cef3733596c6424dee18d7e36bc41162628653b Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 13 Jun 2018 17:05:34 -0400 Subject: [PATCH] c-opts.c (c_common_post_options): Warn about useless -Wabi. * c-opts.c (c_common_post_options): Warn about useless -Wabi. (c_common_handle_option) [OPT_Wabi_]: Remove flag_abi_compat_version handling. From-SVN: r261571 --- gcc/c-family/ChangeLog | 4 ++++ gcc/c-family/c-opts.c | 14 +++++++++++--- gcc/testsuite/g++.dg/abi/pr83489.C | 2 +- gcc/testsuite/obj-c++.dg/bitfield-1.mm | 2 +- gcc/testsuite/obj-c++.dg/layout-1.mm | 2 +- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 72f24fdb772..a1c20973ecf 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,5 +1,9 @@ 2018-06-13 Jason Merrill + * c-opts.c (c_common_post_options): Warn about useless -Wabi. + (c_common_handle_option) [OPT_Wabi_]: Remove flag_abi_compat_version + handling. + PR c++/86094 - wrong code with defaulted move ctor. * c-opts.c (c_common_post_options): Bump the current ABI version to 13. Set warn_abi_version and flag_abi_compat_version to the current diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 107359ec20d..bbcb1bb1a9c 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -417,8 +417,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, value = 2; } warn_abi_version = value; - if (flag_abi_compat_version == -1) - flag_abi_compat_version = value; break; case OPT_fcanonical_system_headers: @@ -942,7 +940,17 @@ c_common_post_options (const char **pfilename) { warn_abi_version = latest_abi_version; if (flag_abi_version == latest_abi_version) - flag_abi_compat_version = abi_compat_default; + { + if (warning (OPT_Wabi, "-Wabi won't warn about anything")) + { + inform (input_location, "-Wabi warns about differences " + "from the most up-to-date ABI, which is also used " + "by default"); + inform (input_location, "use e.g. -Wabi=11 to warn about " + "changes from GCC 7"); + } + flag_abi_compat_version = abi_compat_default; + } else flag_abi_compat_version = latest_abi_version; } diff --git a/gcc/testsuite/g++.dg/abi/pr83489.C b/gcc/testsuite/g++.dg/abi/pr83489.C index aee04eca9d8..b6c82ef16e6 100644 --- a/gcc/testsuite/g++.dg/abi/pr83489.C +++ b/gcc/testsuite/g++.dg/abi/pr83489.C @@ -1,5 +1,5 @@ // PR c++/83489 -// { dg-options "-Wabi" } +// { dg-options "-Wabi=11" } struct A { diff --git a/gcc/testsuite/obj-c++.dg/bitfield-1.mm b/gcc/testsuite/obj-c++.dg/bitfield-1.mm index a63761904b5..084d2cb0916 100644 --- a/gcc/testsuite/obj-c++.dg/bitfield-1.mm +++ b/gcc/testsuite/obj-c++.dg/bitfield-1.mm @@ -5,7 +5,7 @@ superclasses should be removed). */ /* Contributed by Ziemowit Laski . */ /* { dg-do run } */ -/* { dg-options "-Wpadded -Wabi" } */ +/* { dg-options "-Wpadded -Wabi=8" } */ /* Leave blank lines here to keep warnings on the same lines. */ diff --git a/gcc/testsuite/obj-c++.dg/layout-1.mm b/gcc/testsuite/obj-c++.dg/layout-1.mm index 33879ad17a4..89921236ec3 100644 --- a/gcc/testsuite/obj-c++.dg/layout-1.mm +++ b/gcc/testsuite/obj-c++.dg/layout-1.mm @@ -1,7 +1,7 @@ /* Ensure that we do not get bizarre warnings referring to __attribute__((packed)) or some such. */ /* { dg-do compile } */ -/* { dg-options "-Wpadded -Wpacked -Wabi" } */ +/* { dg-options "-Wpadded -Wpacked -Wabi=8" } */ #include "../objc-obj-c++-shared/TestsuiteObject.h" -- 2.30.2