diff options
author | chaoyingfu <chaoyingfu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-21 00:50:37 +0000 |
---|---|---|
committer | chaoyingfu <chaoyingfu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-21 00:50:37 +0000 |
commit | 84786a68feb112962e57bf50061937f84a972154 (patch) | |
tree | 9e6d76d76fb5d25abfc32c061876d9e4067529d5 /gcc/c-decl.c | |
parent | 0ec8236a46671e330f992b677a26f3b3739592b3 (diff) | |
download | gcc-84786a68feb112962e57bf50061937f84a972154.tar.gz |
* 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
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 9 |
1 files changed, 6 insertions, 3 deletions
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; } |