summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/c-cppbuiltin.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2009-03-14 19:36:13 +0000
committerdas <das@FreeBSD.org>2009-03-14 19:36:13 +0000
commitc7efb5498d33bf2d06b809dd5562d0b0f786c54f (patch)
treec558b410b306a19744a89a59566a13b06e62050e /contrib/gcc/c-cppbuiltin.c
parent32a758b56941b6e90a12494c1b354b5155bd5643 (diff)
downloadFreeBSD-src-c7efb5498d33bf2d06b809dd5562d0b0f786c54f.zip
FreeBSD-src-c7efb5498d33bf2d06b809dd5562d0b0f786c54f.tar.gz
Make gcc use C99 inline semantics in c99 and gnu99 mode. This was the
original intent, but the functionality wasn't implemented until after gcc 4.2 was released. However, if you compiled a program that would behave differently before and after this change, gcc 4.2 would have warned you; hence, everything currently in the base system is unaffected by this change. This patch also adds additional warnings about certain inline function-related bogosity, e.g., using a static non-const local variable in an inline function. These changes were merged from a snapshot of gcc mainline from March 2007, prior to the GPLv3 switch. I then ran the regression test suite from a more recent gcc snapshot and fixed the important bugs it found. I also squelched the following warning unless -pedantic is specified: foo is static but used in inline function bar which is not static This is consistent with LLVM's behavior, but not consistent with gcc 4.3. Reviewed by: arch@
Diffstat (limited to 'contrib/gcc/c-cppbuiltin.c')
-rw-r--r--contrib/gcc/c-cppbuiltin.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/gcc/c-cppbuiltin.c b/contrib/gcc/c-cppbuiltin.c
index 45e2acb..906ef55 100644
--- a/contrib/gcc/c-cppbuiltin.c
+++ b/contrib/gcc/c-cppbuiltin.c
@@ -1,5 +1,6 @@
/* Define builtin-in macros for the C family front ends.
- Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -484,7 +485,10 @@ c_cpp_builtins (cpp_reader *pfile)
/* Misc. */
builtin_define_with_value ("__VERSION__", version_string, 1);
- cpp_define (pfile, "__GNUC_GNU_INLINE__");
+ if (flag_gnu89_inline)
+ cpp_define (pfile, "__GNUC_GNU_INLINE__");
+ else
+ cpp_define (pfile, "__GNUC_STDC_INLINE__");
/* Definitions for LP64 model. */
if (TYPE_PRECISION (long_integer_type_node) == 64
OpenPOWER on IntegriCloud