summaryrefslogtreecommitdiff
path: root/gcc/c-cppbuiltin.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-23 16:53:53 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-23 16:53:53 +0000
commit26785ec8d2a7c04eb8c0a8a44c9fec5515c2e64b (patch)
tree730fb1dd5cb47c7638fd2ccd44d2e5ecb188026c /gcc/c-cppbuiltin.c
parentcadce113723715a4985d8ea3925ac95c66cf1076 (diff)
downloadgcc-26785ec8d2a7c04eb8c0a8a44c9fec5515c2e64b.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74973 138bc75d-0d04-0410-961f-82ee72b054a4
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 19a9cf48106..739a34224b1 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)