aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-opts.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-09-22 11:18:26 -0400
committerJason Merrill <jason@gcc.gnu.org>2015-09-22 11:18:26 -0400
commita75f15742ab04d48fb599c9b6523ffbe8f5d837c (patch)
tree44c7e77abec314f6ccab830cf576cb24d797c18e /gcc/c-family/c-opts.c
parent8013b816cc8b2de17db1a5115f4df482f0acbc6d (diff)
downloadgcc-a75f15742ab04d48fb599c9b6523ffbe8f5d837c.zip
gcc-a75f15742ab04d48fb599c9b6523ffbe8f5d837c.tar.gz
gcc-a75f15742ab04d48fb599c9b6523ffbe8f5d837c.tar.bz2
Disconnect -Wabi=<n> from -fabi-compat-version=<n>.
gcc/c-family/ * c-common.h (abi_compat_version_crosses): New. (warn_abi_version): Declare. * c-common.c: Define it. * c-opts.c (c_common_post_options): Handle it. flag_abi_compat_version defaults to 8. gcc/cp/ * mangle.c (abi_warn_or_compat_version_crosses): New. Use it instead of abi_version_crosses. (mangle_decl): Deal with -fabi-compat-version and -Wabi separately. From-SVN: r228017
Diffstat (limited to 'gcc/c-family/c-opts.c')
-rw-r--r--gcc/c-family/c-opts.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index f358b62..bf2e6b0 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -397,7 +397,9 @@ c_common_handle_option (size_t scode, const char *arg, int value,
warning (0, "%<-Wabi=1%> is not supported, using =2");
value = 2;
}
- flag_abi_compat_version = value;
+ warn_abi_version = value;
+ if (flag_abi_compat_version == -1)
+ flag_abi_compat_version = value;
break;
case OPT_fcanonical_system_headers:
@@ -870,6 +872,14 @@ c_common_post_options (const char **pfilename)
if (flag_declone_ctor_dtor == -1)
flag_declone_ctor_dtor = optimize_size;
+ if (warn_abi_version == -1)
+ {
+ if (flag_abi_compat_version != -1)
+ warn_abi_version = flag_abi_compat_version;
+ else
+ warn_abi_version = 0;
+ }
+
if (flag_abi_compat_version == 1)
{
warning (0, "%<-fabi-compat-version=1%> is not supported, using =2");
@@ -877,13 +887,9 @@ c_common_post_options (const char **pfilename)
}
else if (flag_abi_compat_version == -1)
{
- /* Generate compatibility aliases for ABI v2 (3.4-4.9) by default. */
- flag_abi_compat_version = (flag_abi_version == 0 ? 2 : 0);
-
- /* But don't warn about backward compatibility unless explicitly
- requested with -Wabi=n. */
- if (flag_abi_version == 0)
- warn_abi = false;
+ /* Generate compatibility aliases for ABI v8 (5.1) by default. */
+ flag_abi_compat_version
+ = (flag_abi_version == 0 ? 8 : 0);
}
/* Change flag_abi_version to be the actual current ABI level for the