From: Nigel Stephens Date: Fri, 21 Sep 2007 00:50:37 +0000 (+0000) Subject: c-decl.c (finish_declspecs): When _Sat is used without _Fract or _Accum, set the... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=819fec00238bbbc881d99c945c55d648d62702c2;p=gcc.git 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 From-SVN: r128642 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 99d77b15714..1c05e345159 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-09-20 Nigel Stephens + Chao-ying Fu + + * 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 * 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 493a57ed714..1152253e2e2 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; }