From 84786a68feb112962e57bf50061937f84a972154 Mon Sep 17 00:00:00 2001 From: chaoyingfu Date: Fri, 21 Sep 2007 00:50:37 +0000 Subject: * 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". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128642 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-decl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gcc/c-decl.c') 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; } -- cgit v1.2.1