[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: apr_strnatcasecmp vs. strcasecmp

From: Mark Phippard <markp_at_softlanding.com>
Date: 2006-02-17 16:42:54 CET

Peter Samuelson <peter@p12n.org> wrote on 02/17/2006 04:08:32 AM:

> [Mark Phippard]
> > I did some digging on the two compiled objects and noticed that they
> > were linking different runtime functions (Subversion was apparently
> > linking the EBCDIC version). I went back to IBM with this and we
> > each did some more digging and appear to have figured it out:
> >
> > Subversion uses #include <string.h> but to get the UTF8 support in
> > this function on OS/400 you need to #include <strings.h>. Does this
> > make sense to anyone?
>
> i.e., the names of the functions are redefined, because both UTF-8 and
> EBCDIC versions are available in the same libraries. That would
> explain the observed behavior: function names aren't redefined to use
> the UTF-8 version.
>
> Note that in C, function prototypes are not required, so you often
> don't even notice forgetting to include the correct header file.
> (There are warnings you can enable to catch this.)

Thanks, the IBM compiler team essentially gave the same answer.
Ultimately, this function is only declared in strings.h and the compiler
issues a warning that we were missing when the prototype is not found.
Since the C runtime has a function named strcasecmp (for EBCDIC strings)
the linker does not have a problem.

So our answer will be to in someway get strings.h included.

The IBM docs say that all string functions are declared in string.h EXCEPT
for str(n)casecmp which are declared in strings.h.

Mark

_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. and SoftLanding Europe Plc by IBM Email Security Management Services powered by MessageLabs.
_____________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 17 16:50:36 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.