Re: prohibit_strcmp

2012-02-24 Thread Bruno Haible
Jim Meyering wrote: > > Akim suggests to rename STREQ in lib/streq.h; what name would you suggest? > > STREQ_ retains the name and look while adding only one to the length. > STREQ_opt is more descriptive, but longer I generally prefer the more descriptive names. So, committed as follows: 2012-

Re: prohibit_strcmp

2012-02-24 Thread Jim Meyering
Akim Demaille wrote: > Le 24 févr. 2012 à 10:08, Jim Meyering a écrit : > >> Here's a complete patch, with the additional tweak of replacing >> the other occurrence of str''cmp with $(s_). > > Actually I don't think you need it. Ironically, > you need it only when not factoring it, and this > give

Re: prohibit_strcmp

2012-02-24 Thread Akim Demaille
Le 24 févr. 2012 à 10:08, Jim Meyering a écrit : > Here's a complete patch, with the additional tweak of replacing > the other occurrence of str''cmp with $(s_). Actually I don't think you need it. Ironically, you need it only when not factoring it, and this gives a furious desire to factor it

Re: prohibit_strcmp

2012-02-24 Thread Jim Meyering
Jim Meyering wrote: > Akim Demaille wrote: > >> Also, FWIW, in Bison there are many more strcmp, but they do not >> conform to the sc pattern. >> >> src/ielr.c:if (0 == strcmp (type, "lalr")) >> src/ielr.c:else if (0 == strcmp (type, "ielr")) >> src/ielr.c:else if (0 == strcmp (type, "c

Re: prohibit_strcmp

2012-02-24 Thread Jim Meyering
Bruno Haible wrote: >> That gnulib has two definitions is unfortunate, but I will not >> volunteer to change the STREQ that I've been using ;-) >> I don't see much value in streq.h, either, and hence, don't use it. > > The value of streq.h is an optimized definition which is used in a few > places.

Re: prohibit_strcmp

2012-02-24 Thread Akim Demaille
hi Bruno, Le 23 févr. 2012 à 21:00, Bruno Haible a écrit : >> I use STRNCMP_LIT defined in coreutils/src/system.h: >> >>/* Just like strncmp, but the second argument must be a literal string >> and you don't specify the length. */ >>#define STRNCMP_LIT(s, literal) \ >> strncm

Re: prohibit_strcmp

2012-02-23 Thread Bruno Haible
Hi Jim, > That gnulib has two definitions is unfortunate, but I will not > volunteer to change the STREQ that I've been using ;-) > I don't see much value in streq.h, either, and hence, don't use it. The value of streq.h is an optimized definition which is used in a few places. I agree that your

Re: prohibit_strcmp

2012-02-23 Thread Akim Demaille
/system.h: > >/* Just like strncmp, but the second argument must be a literal string > and you don't specify the length. */ >#define STRNCMP_LIT(s, literal) \ > strncmp (s, "" literal "", sizeof (literal) - 1) Good to know, thanks! >>

Re: prohibit_strcmp

2012-02-23 Thread Jim Meyering
Akim Demaille wrote: > Also, FWIW, in Bison there are many more strcmp, but they do not > conform to the sc pattern. > > src/ielr.c:if (0 == strcmp (type, "lalr")) > src/ielr.c:else if (0 == strcmp (type, "ielr")) > src/ielr.c:else if (0 == strcmp (type, "canonical-lr")) How about thi

Re: prohibit_strcmp

2012-02-23 Thread Akim Demaille
Also, FWIW, in Bison there are many more strcmp, but they do not conform to the sc pattern. src/ielr.c:if (0 == strcmp (type, "lalr")) src/ielr.c:else if (0 == strcmp (type, "ielr")) src/ielr.c:else if (0 == strcmp (type, "canonical-lr"))

Re: prohibit_strcmp

2012-02-23 Thread Jim Meyering
Akim Demaille wrote: > Bison features some warnings from syntax-check: > > prohibit_strcmp > ../../doc/bison.texinfo:2572:if (strcmp (ptr->name,sym_name) == 0) > ../../src/files.c:145: if (strcmp (ext, ".y") == 0) > ../../src/muscle-tab.c:53: return

prohibit_strcmp

2012-02-23 Thread Akim Demaille
Hi! Bison features some warnings from syntax-check: prohibit_strcmp ../../doc/bison.texinfo:2572:if (strcmp (ptr->name,sym_name) == 0) ../../src/files.c:145: if (strcmp (ext, ".y") == 0) ../../src/muscle-tab.c:53: return strcmp (m1->key, m2->key) == 0; ../../src/musc