weird error with nmh
Harti Brandt
hartmut.brandt at dlr.de
Tue Jun 26 07:48:21 UTC 2007
On Sun, 24 Jun 2007, Gary Jennejohn wrote:
GJ>I'm using exmh with nmh on a freshly installed AMD64-current:
GJ> 7.0-CURRENT FreeBSD 7.0-CURRENT #4: Sat Jun 23 19:29:01 CEST
GJ>2007
GJ>
GJ>nmh uses its own version of strcasecmp() because in many cases it
GJ>passes NULL pointers to it and must check for that.
GJ>
GJ>However, somehow the version in libc gets used rather than the version
GJ>from nmh and calling e.g. repl results in a SIGSEGV because the NULL
GJ>pointer is dereferenced.
GJ>
GJ>I was forced to rename the routine to nmhstrcasecmp() all over the
GJ>place. After that repl works.
GJ>
GJ>My question - why isn't the version in nmh overriding the version in
GJ>libc? Am I misunderstanding something here?
Strictly speaking from the standards point of view an application is not
allowed to redefine (standard) functions from libc. Also function names
str[a-z]*() are in the standard's namespace and should not be defined in
an application. So formally having a strcasecmp() in an application leads
to undefined behaviour.
People are used to be able to redefine library functions, though ...
harti
More information about the freebsd-current
mailing list