From owner-freebsd-current@FreeBSD.ORG Tue Jun 26 07:48:21 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1C18C16A421 for ; Tue, 26 Jun 2007 07:48:21 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from smtp-3.dlr.de (smtp-3.dlr.de [195.37.61.187]) by mx1.freebsd.org (Postfix) with ESMTP id ADC0513C447 for ; Tue, 26 Jun 2007 07:48:20 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from knop-beagle.kn.op.dlr.de ([129.247.173.6]) by smtp-3.dlr.de over TLS secured channel with Microsoft SMTPSVC(6.0.3790.1830); Tue, 26 Jun 2007 09:35:03 +0200 Date: Tue, 26 Jun 2007 09:35:00 +0200 (CEST) From: Harti Brandt X-X-Sender: brandt_h@knop-beagle.kn.op.dlr.de To: gary.jennejohn@freenet.de In-Reply-To: <20070624191345.7f08c10e.garyj@jennejohn.org> Message-ID: <20070626092710.V59611@knop-beagle.kn.op.dlr.de> References: <20070624191345.7f08c10e.garyj@jennejohn.org> X-OpenPGP-Key: harti@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 26 Jun 2007 07:35:03.0322 (UTC) FILETIME=[82704FA0:01C7B7C4] Cc: freebsd-current@freebsd.org Subject: Re: weird error with nmh X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Harti Brandt List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2007 07:48:21 -0000 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