On Wed, 2009-02-11 at 22:47 +0000, Joseph S. Myers wrote: > On Wed, 11 Feb 2009, Janis Johnson wrote: > > > I'm rewriting function interpret_float_suffix in libcpp/expr.c to fix > > suffixes in decimal float literal constants for c/33466. While I'm at > > it I'm fixing suffixes for fixed-point literal constants. Currently for > > fixed-point GCC accepts any ordering of the letters in the suffix. The > > technical report (N1169) gives specific strings, not individual letters > > that can be used in any order. That seems like something obvious to fix > > but I thought I'd mention it in case they really should be accepted in > > any order. > > I believe you should follow the formal syntax, 6.4.4.2a (at least in > N1275, the most recent version I know of, on page 16 of that document). > This does not allow them in multiple orders. It uses long-suffix from the > C99 syntax.
Thanks for the reference. I had been looking earlier in the document at a table of suffixes, but this section makes it clear. > > My question, though, is about the case of the letters in the suffixes. > > N1169 says "note that the suffix is case insensitive"; should I take > > that literally and allow any mix of cases (as GCC currently does), or > > require that the same case be used within a particular suffix? > > The syntax allows a mix of cases. Yes, that's also clear in the section you referenced. > > GCC accepts ll or LL, but not lL or Ll, in fixed-point suffixes. These > > are not in N1169; is there a later draft TR that includes them or are > > they simply a GNU extension on top of the draft TR? > > I presume the extension is to add long-long-suffix somewhere in the > syntax, which means ll or LL but not lL or Ll because those aren't in C99 > which defines long-long-suffix. That makes sense, I'll go with that. Janis