aboutsummaryrefslogtreecommitdiff
path: root/gcc
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
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')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/c-decl.c9
2 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 99d77b1..1c05e34 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2007-09-20 Nigel Stephens <nigel@mips.com>
+ Chao-ying Fu <fu@mips.com>
+
+ * 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".
+
2007-09-20 Joseph Myers <joseph@codesourcery.com>
* c-decl.c (check_bitfield_type_and_width): Don't allow _Bool
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;
}