Review of the last few applied patches...

Rich Felker dalias at aerifal.cx
Sat May 20 02:21:07 UTC 2006


On Fri, May 19, 2006 at 06:25:42PM -0400, Rob Landley wrote:
> Under linux, #include <string.h> defines strcasecmp(), which is why we didn't 
> see a warning.  You don't need strings.h.  In fact having a separate 
> "string.h" and "strings.h" at all strikes me as deep and abiding stupidity on 
> the part of somebody upstream.  There's no _CHANCE_ to keep those straight in 
> one's head, and no obvious reason to try.  (Hence linux including one from 
> the other for sanity.)

The functions in strings.h are legacy stuff that should not be used at
all. POSIX put them there so as not to pollute the standard C header
with functions that do not belong.

Keeping them straight is easy: the C standard functions are in
string.h. The legacy unix functions specified as XSI extensions are in
strings.h. If you know C you should know the difference. :)

> What exactly is the problem being solved here?  (Doesn't build on some 
> platform that's more pedanitc/less sane than Linux?  Which one?)

It doesn't build on my implementation which does not pollute the
namespace by including extra headers you didn't ask for.

(Actually it does build, but with warnings, and these warnings would
lead to runtime crashes on 64bit systems due to
sizeof(int)!=sizeof(void*)).

Rich




More information about the busybox mailing list