This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Integer constant parsing overhaul
On Thu, Aug 23, 2001 at 06:39:16PM +0100, Neil Booth wrote:
> Hi Zack,
>
> This looks good. I have a couple of nits that you may or may not
> agree with.
[...]
> > + handling in GCC proper is too ugly to speak of. */
>
> Maybe this should be moved to above cpp_classify_number(), which has
> no comment immediately above it.
Good idea...
> How about scrapping this last if statement and its block, and putting
> something like the following in the switch?
>
> case 'l': case 'L':
> if (l++ && s[n - 1] != s[n - 2])
> return 0;
> break;
>
> Then you can lose save_n too. This might written a little more
> cleanly by decrementing n as part of the loop condition.
You're right that the way it's written is confusing, but I am not
sure whether your way is an improvement - particularly in view of
your second message about this. I'll see what I can do.
> > + unsigned HOST_WIDEST_INT
> > + cpp_interpret_integer (pfile, tok, flags)
>
> No comment for this function.
Argh.
> > ! for (; itk < itk_none; itk += 2 /* skip signed types */)
> > ! if (int_fits_type_p (value, integer_types[itk]))
> > ! return itk;
>
> Skip unsigned types?
Yep. Cut-and-paste error.
> Some of the comments in the code don't really
> follow the GNU coding standards.
These inside-the-loop-expression comments would be less helpful
if written as complete sentences on a separate line, IMO. Where I
put them, it's quite clear what they are explaining.
zw