diff options
author | Jeff Law <law@gcc.gnu.org> | 1997-08-11 09:56:58 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1997-08-11 09:56:58 -0600 |
commit | 861bb6c1b0958236ad93717f98d347aa6152bd09 (patch) | |
tree | b2e1ea43e0bdba8cca9bb02ed01f5e3da5a955a6 /gcc/c-decl.c | |
parent | 737cee66f221eb8de21f0e41affc4b13cb7c0feb (diff) | |
download | gcc-861bb6c1b0958236ad93717f98d347aa6152bd09.zip gcc-861bb6c1b0958236ad93717f98d347aa6152bd09.tar.gz gcc-861bb6c1b0958236ad93717f98d347aa6152bd09.tar.bz2 |
Initial revisionmisc/cutover-egcs-1
From-SVN: r14764
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 125f0f4..b556d08 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4339,7 +4339,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) /* Long double is a special combination. */ - if ((specbits & 1 << (int) RID_LONG) + if ((specbits & 1 << (int) RID_LONG) && ! longlong && TYPE_MAIN_VARIANT (type) == double_type_node) { specbits &= ~ (1 << (int) RID_LONG); @@ -4353,11 +4353,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) { int ok = 0; - if (TREE_CODE (type) != INTEGER_TYPE) - error ("long, short, signed or unsigned invalid for `%s'", name); - else if ((specbits & 1 << (int) RID_LONG) - && (specbits & 1 << (int) RID_SHORT)) - error ("long and short specified together for `%s'", name); + if ((specbits & 1 << (int) RID_LONG) + && (specbits & 1 << (int) RID_SHORT)) + error ("both long and short specified for `%s'", name); else if (((specbits & 1 << (int) RID_LONG) || (specbits & 1 << (int) RID_SHORT)) && explicit_char) @@ -4365,10 +4363,21 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) else if (((specbits & 1 << (int) RID_LONG) || (specbits & 1 << (int) RID_SHORT)) && TREE_CODE (type) == REAL_TYPE) - error ("long or short specified with floating type for `%s'", name); + { + static int already = 0; + + error ("long or short specified with floating type for `%s'", name); + if (! already && ! pedantic) + { + error ("the only valid combination is `long double'"); + already = 1; + } + } else if ((specbits & 1 << (int) RID_SIGNED) && (specbits & 1 << (int) RID_UNSIGNED)) - error ("signed and unsigned given together for `%s'", name); + error ("both signed and unsigned specified for `%s'", name); + else if (TREE_CODE (type) != INTEGER_TYPE) + error ("long, short, signed or unsigned invalid for `%s'", name); else { ok = 1; |