This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C PATCH to suppress a bogus "defaulting to int" warning (PR c/77323)
- From: Marek Polacek <polacek at redhat dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Joseph Myers <joseph at codesourcery dot com>
- Date: Wed, 24 Aug 2016 12:20:21 +0200
- Subject: Re: C PATCH to suppress a bogus "defaulting to int" warning (PR c/77323)
- Authentication-results: sourceware.org; auth=none
- References: <20160824101817.GD11131@redhat.com>
On Wed, Aug 24, 2016 at 12:18:17PM +0200, Marek Polacek wrote:
> When declaring something using an unsupported type specifier, such as __int128
> on 32-bit systems, or _Float128x, the error for the unsupported type is
> followed by a warning about the type defaulting to int.
>
> But for unsupported types this warning isn't useful. The problem was that for
> these unsupported types typespec_word was set to cts_none, so in
> finish_declspecs we'd set default_int_p and thus warn in grokdeclarator.
>
> How to fix this became clear when I looked at how we handle fixed-point types
> and decimal floating point types -- by setting typespec_word even when we've
> given an error. The finish_declspecs hunk is needed so that we don't pass
> a null type to grokdeclarator.
>
> Tested also with
> make check-c RUNTESTFLAGS='dg.exp=pr77323.c --target_board=unix\{-m32,-m64\}'
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
And now tested on ppc64le-redhat-linux, too.
Marek