summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-opts.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-opts.c')
-rw-r--r--gcc/c-family/c-opts.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 29e9a355bee..fbbc80ee94a 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -456,6 +456,16 @@ c_common_handle_option (size_t scode, const char *arg, int value,
handle_OPT_d (arg);
break;
+ case OPT_Wabi_:
+ warn_abi = true;
+ if (value == 1)
+ {
+ warning (0, "%<-Wabi=1%> is not supported, using =2");
+ value = 2;
+ }
+ flag_abi_compat_version = value;
+ break;
+
case OPT_fcanonical_system_headers:
cpp_opts->canonical_system_headers = value;
break;
@@ -910,6 +920,22 @@ c_common_post_options (const char **pfilename)
if (flag_declone_ctor_dtor == -1)
flag_declone_ctor_dtor = optimize_size;
+ if (flag_abi_compat_version == 1)
+ {
+ warning (0, "%<-fabi-compat-version=1%> is not supported, using =2");
+ flag_abi_compat_version = 2;
+ }
+ 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;
+ }
+
if (cxx_dialect >= cxx11)
{
/* If we're allowing C++0x constructs, don't warn about C++98