aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-cppbuiltin.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-12-23 16:53:53 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-12-23 16:53:53 +0000
commit57702a80e805859260710953242bf87c08f5c410 (patch)
tree730fb1dd5cb47c7638fd2ccd44d2e5ecb188026c /gcc/c-cppbuiltin.c
parent32a2571b0cafa323c8133b1fb5a11c036a58a9e5 (diff)
downloadgcc-57702a80e805859260710953242bf87c08f5c410.zip
gcc-57702a80e805859260710953242bf87c08f5c410.tar.gz
gcc-57702a80e805859260710953242bf87c08f5c410.tar.bz2
c-common.c (flag_abi_version): Default to 2.
* c-common.c (flag_abi_version): Default to 2. * c-cppbuiltin.c (c_cpp_builtins): Define __GXX_ABI_VERSION uniformly for versions above 2. * doc/invoke.texi: Update documentation for -fabi-version. * cp-lang.c (cp_expr_size): Return zero for empty classes. * cp-tree.h (warn_if_uknown_interface): Remove unused function. * decl2.c (warn_if_unknown_interface): Likewise. * g++.dg/abi/macro0.C: New test. * g++.dg/abi/macro1.C: Likewise. * g++.dg/abi/macro2.C: Likewise. * g++.dg/abi/bitfield5.C: Add explicit -fabi-version=1 option. * g++.dg/abi/bitfield7.C: Likewise. * g++.dg/abi/dtor2.C: Likewise. * g++.dg/abi/mangle11.C: Likewise. * g++.dg/abi/mangle12.C: Likewise. * g++.dg/abi/mangle14.C: Likewise. * g++.dg/abi/mangle17.C: Likewise. * g++.dg/abi/vbase10.C: Likewise. * g++.dg/abi/vbase14.C: Likewise. * g++.dg/template/qualttp17.C: Likewise. From-SVN: r74973
Diffstat (limited to 'gcc/c-cppbuiltin.c')
-rw-r--r--gcc/c-cppbuiltin.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 19a9cf4..739a342 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -310,7 +310,23 @@ c_cpp_builtins (cpp_reader *pfile)
/* represents the C++ ABI version, always defined so it can be used while
preprocessing C and assembler. */
- cpp_define (pfile, "__GXX_ABI_VERSION=102");
+ if (flag_abi_version == 0)
+ /* Use a very large value so that:
+
+ #if __GXX_ABI_VERSION >= <value for version X>
+
+ will work whether the user explicitly says "-fabi-version=x" or
+ "-fabi-version=0". Do not use INT_MAX because that will be
+ different from system to system. */
+ builtin_define_with_int_value ("__GXX_ABI_VERSION", 999999);
+ else if (flag_abi_version == 1)
+ /* Due to an historical accident, this version had the value
+ "102". */
+ builtin_define_with_int_value ("__GXX_ABI_VERSION", 102);
+ else
+ /* Newer versions have values 1002, 1003, ... */
+ builtin_define_with_int_value ("__GXX_ABI_VERSION",
+ 1000 + flag_abi_version);
/* libgcc needs to know this. */
if (USING_SJLJ_EXCEPTIONS)