Re: weird error with nmh

From: Harti Brandt <hartmut.brandt_at_dlr.de>
Date: Tue, 26 Jun 2007 09:35:00 +0200 (CEST)
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
Received on Tue Jun 26 2007 - 05:48:21 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:13 UTC