This is the mail archive of the
mailing list for the GCC project.
RE: [PATCH, C/C++] Add -fno-float to forbid floating point data types
- From: "Thomas Preud'homme" <thomas dot preudhomme at arm dot com>
- To: "'Marek Polacek'" <polacek at redhat dot com>, "Jakub Jelinek" <jakub at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 14 Aug 2014 10:53:17 +0800
- Subject: RE: [PATCH, C/C++] Add -fno-float to forbid floating point data types
- Authentication-results: sourceware.org; auth=none
- References: <000701cfb60f$5b859700$1290c500$ at arm dot com> <20140812093435 dot GI1784 at tucnak dot redhat dot com> <20140812094301 dot GH2436 at redhat dot com>
> From: Marek Polacek [mailto:email@example.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.