From: <ste...@el...> - 2004-02-06 10:07:29
|
On Thu, Feb 05, 2004 at 03:16:21PM -0700, Russ Dill wrote: > On Thu, 2004-02-05 at 11:49, Stefan Eletzhofer wrote: > > Update of /cvsroot/blob/blob/src/lib > > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25457/lib > > > > Modified Files: > > download.c > > Log Message: > > Remove strcmp() calls, use strncmp(). > > the strncmp calls were removed on purpose. Making you sit there and > count the characters is error prone. strcmp in blob is just a macro: > > #define strcmp(s1, s2) \ > (__builtin_constant_p(s1) ? strncmp(s1, s2, sizeof(s1)) : \ > (__builtin_constant_p(s2) ? strncmp(s1, s2, sizeof(s2)) : \ > unsafe_strcmp_call(s1, s2))) But I got link errors. The above macro ended up un a call to unsave_strcmp_call(). Thats why I noticed, and thus converted the whole mess. I didnt notice this macro, I thought erik removed strcmp() altogether. (This was gcc 2.95.3) > > If one of the arguments is not a constant, then it will cause a link error. > Otherwise, it will count the number of characters for you, and replace the > call with strncmp > > -- > Russ Dill <Rus...@as...> -- Eletztrick Computing - Customized Linux Development Stefan Eletzhofer, Marktstrasse 43, DE-88214 Ravensburg http://www.eletztrick.de |