[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: STREQ in dfa.c
From: |
Jim Meyering |
Subject: |
Re: STREQ in dfa.c |
Date: |
Sat, 31 Dec 2011 18:48:15 +0100 |
address@hidden wrote:
> Hi Jim et al.
>
>> It's a little annoying that STREQ is already defined in two places
>> (we prefer to keep dfa.c self-contained, to accommodate gawk):
>>
>> $ git grep fine.STREQ
>> src/dfa.c:#define STREQ(a, b) (strcmp (a, b) == 0)
>> src/main.c:#define STREQ(a, b) (strcmp (a, b) == 0)
>>
>> You may want to simply exempt those two files from that check.
>
> There are not a lot of uses of STREQ in dfa.c. I'd be happy if you
> expanded the macro there.
Sorry, but that would be a step backwards.
I find that direct use of strcmp is markedly less readable
when the result is used as a boolean.
> Gawk's STREQ checks *a == *b before calling
> strcmp, which is an OOOOLLLLDDDD speed hack from the PDP-11 / Vax
> days. I should probably get rid of it.
Good idea.
- STREQ in dfa.c, arnold, 2011/12/31
- Re: STREQ in dfa.c,
Jim Meyering <=