aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2006-11-04 02:59:52 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2006-11-04 02:59:52 +0000
commitc7cc12b01d5c608fb214cb7a69e7f40a35ac8fe8 (patch)
tree2fdeb9386ae83b7833d96efa88d407501461ca90 /gcc/c-decl.c
parentc79154c4fafac337a11f8c99fd57070b9266d452 (diff)
downloadgcc-c7cc12b01d5c608fb214cb7a69e7f40a35ac8fe8.zip
gcc-c7cc12b01d5c608fb214cb7a69e7f40a35ac8fe8.tar.gz
gcc-c7cc12b01d5c608fb214cb7a69e7f40a35ac8fe8.tar.bz2
c-decl.c (WANT_C99_INLINE_SEMANTICS): New, set to 1.
* c-decl.c (WANT_C99_INLINE_SEMANTICS): New, set to 1. (merge_decls): Implement WANT_C99_INLINE_SEMANTICS. (grokdeclarator): Likewise. From-SVN: r118474
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 34709df..a49b88b 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -62,6 +62,12 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "langhooks-def.h"
#include "pointer-set.h"
+/* Set this to 1 if you want the standard ISO C99 semantics of 'inline'
+ when you specify -std=c99 or -std=gnuc99, and to 0 if you want
+ behaviour compatible with the nonstandard semantics implemented by
+ GCC 2.95 through 4.2. */
+#define WANT_C99_INLINE_SEMANTICS 1
+
/* In grokdeclarator, distinguish syntactic contexts of declarators. */
enum decl_context
{ NORMAL, /* Ordinary declaration */
@@ -1760,6 +1766,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
}
}
+#if WANT_C99_INLINE_SEMANTICS
/* In c99, 'extern' declaration before (or after) 'inline' means this
function is not DECL_EXTERNAL. */
if (TREE_CODE (newdecl) == FUNCTION_DECL
@@ -1771,6 +1778,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
&& DECL_EXTERNAL (newdecl)
&& flag_isoc99)
DECL_EXTERNAL (newdecl) = 0;
+#endif /* WANT_C99_INLINE_SEMANTICS */
if (DECL_EXTERNAL (newdecl))
{
@@ -4772,7 +4780,11 @@ grokdeclarator (const struct c_declarator *declarator,
in this file, C99 6.7.4p6. In GNU C89, a function declared
'extern inline' is an external reference. */
else if (declspecs->inline_p && storage_class != csc_static)
+#if WANT_C99_INLINE_SEMANTICS
DECL_EXTERNAL (decl) = (storage_class == csc_extern) == !flag_isoc99;
+#else
+ DECL_EXTERNAL (decl) = (storage_class == csc_extern);
+#endif
else
DECL_EXTERNAL (decl) = !initialized;