Date: Tue, 26 Jun 2007 09:35:00 +0200 (CEST) From: Harti Brandt <hartmut.brandt@dlr.de> To: gary.jennejohn@freenet.de Cc: freebsd-current@freebsd.org Subject: Re: weird error with nmh Message-ID: <20070626092710.V59611@knop-beagle.kn.op.dlr.de> In-Reply-To: <20070624191345.7f08c10e.garyj@jennejohn.org> References: <20070624191345.7f08c10e.garyj@jennejohn.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070626092710.V59611>