[PATCH, C/C++] Add -fno-float to forbid floating point data types

Thomas Preud'homme thomas.preudhomme@arm.com
Thu Aug 14 04:43:00 GMT 2014


> From: Marek Polacek [mailto:polacek@redhat.com]
> Sent: Tuesday, August 12, 2014 5:43 PM
> On Tue, Aug 12, 2014 at 11:34:35AM +0200, Jakub Jelinek wrote:
> >
> > This looks wrong.  c_token_starts_typename is just a function which tells
> > you if certain token can start a typename, issuing diagnostics there doesn't
> > make sense, that routine doesn't actually parse the token.  You should
> > diagnose it where you actually parse it.
> 
> I'd say the proper place would be declspecs_add_type.

Wouldn't that miss casts and sizeof for instance? It's true that
c_token_starts_typename is not the place where the token is parsed but it
seemed a more central place: it catches all these cases in one check. Ok
maybe sizeof (float) should be ignored but I suppose if you use that you
intend to store a float later.

On the other hand I do want to distinguish float declared in prototypes from
float declared elsewhere.

Best regards,

Thomas




More information about the Gcc-patches mailing list