N
Nick
Seebs said:Because sloppy work is habit forming.
It means that if you get in the habit of writing code which relies on
non-portable things without good justifications, you will spend more
time dealing with the aftermath later, usually at the least convenient
possible time.
We were talking about strcasecmp(), which is not as widely available
as you might think -- largely because, while the functionality is common,
some systems call it stricmp().
Which is why my messy-bits-of-stuff file has caseless_strcmp #defined to
one or the other. If you don't have either you can write your own, of
course. I also keep in the right part of the namespace, and have a more
meaningful name as well (the one thing that strcasecmp isn't is "case").
I actually use autoconf to find out which is around, but just doing it
by hand is a big step forwards.
It took me years to realise the benefits of these sorts of things.