This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch/libiberty]: Rewrite of ada_demangle
- From: Ian Lance Taylor <iant at google dot com>
- To: Tristan Gingold <gingold at adacore dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Binutils <binutils at sourceware dot org>
- Date: Mon, 4 Jan 2010 13:51:37 -0800
- Subject: Re: [Patch/libiberty]: Rewrite of ada_demangle
- References: <F15337BC-7884-42AF-A54D-18E2943370F6@adacore.com>
> include/
> 2009-12-09 ?Tristan Gingold ?<gingold@adacore.com>
>
> ? ? ? ?* demangle.h (ada_demangle): Add prototype.
>
> libiberty/
> 2009-12-09 ?Tristan Gingold ?<gingold@adacore.com>
>
> ? ? ? ?* cplus-dem.c (ada_demangle): Remove prototype.
> ? ? ? ?(grow_vect): Removed.
> ? ? ? ?(ada_demangle): Rewritten.
> ? ? ? ?(cplus_demangle): Fix indentation.
> ? ? ? ?* testsuite/demangle-expected: Add tests for Ada.
> + ? ? ? ? ? ? ?int l = strlen (operators[k][0]);
> + ? ? ? ? ? ? ?if (!strncmp (p, operators[k][0], l))
Please write strncmp (p, operators[k][0], l) == 0.
The variable name "l" may be confusing in a code sequence which also
uses "1". You may want to consider renaming the variable to be "len"
or something along those lines.
> + ? ? ? ? ?/* Operator not found. ?*/
> + ? ? ? ? ?if (!operators[k][0])
> + ? ? ? ? ? ?goto unknown;
Please write operators[k][0] == NULL.
This is OK with those changes, assuming it passes a gcc bootstrap.
Thanks.
Ian