This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C PATCH to suppress a bogus "defaulting to int" warning (PR c/77323)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]