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
This commit is contained in:
parent
43c71fd353
commit
819fec0023
2 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue