aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorNigel Stephens <nigel@mips.com>2007-09-21 00:50:37 +0000
committerChao-ying Fu <chaoyingfu@gcc.gnu.org>2007-09-21 00:50:37 +0000
commit819fec00238bbbc881d99c945c55d648d62702c2 (patch)
tree9e6d76d76fb5d25abfc32c061876d9e4067529d5 /gcc/c-decl.c
parent43c71fd353bd8fce4251b993240cc0536983f05e (diff)
downloadgcc-819fec00238bbbc881d99c945c55d648d62702c2.zip
gcc-819fec00238bbbc881d99c945c55d648d62702c2.tar.gz
gcc-819fec00238bbbc881d99c945c55d648d62702c2.tar.bz2
c-decl.c (finish_declspecs): When _Sat is used without _Fract or _Accum, set the default type to cts_fract.
* c-decl.c (finish_declspecs): When _Sat is used without _Fract or _Accum, set the default type to cts_fract. This avoids a warning of "type defaults to int". Co-Authored-By: Chao-ying Fu <fu@mips.com> From-SVN: r128642
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 493a57e..1152253 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -7767,9 +7767,12 @@ finish_declspecs (struct c_declspecs *specs)
if (specs->typespec_word == cts_none)
{
if (specs->saturating_p)
- error ("%<_Sat%> is used without %<_Fract%> or %<_Accum%>");
- if (specs->long_p || specs->short_p
- || specs->signed_p || specs->unsigned_p)
+ {
+ error ("%<_Sat%> is used without %<_Fract%> or %<_Accum%>");
+ specs->typespec_word = cts_fract;
+ }
+ else if (specs->long_p || specs->short_p
+ || specs->signed_p || specs->unsigned_p)
{
specs->typespec_word = cts_int;
}