delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2001/12/05/08:29:52

Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm
Sender: cygwin-apps-owner AT cygwin DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT cygwin DOT com>
List-Help: <mailto:cygwin-apps-help AT cygwin DOT com>, <http://sources.redhat.com/lists.html#faqs>
Delivered-To: mailing list cygwin-apps AT cygwin DOT com
Message-ID: <3C0E20F3.82A4F5FA@yahoo.com>
Date: Wed, 05 Dec 2001 08:28:19 -0500
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Reply-To: CA List <Cygwin-Apps AT cygwin DOT com>
X-Mailer: Mozilla 4.77 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: egor duda <cygwin-apps AT cygwin DOT com>
Subject: Re: string.h vs string.h usage
References: <3C0E0C4C DOT 73A1750D AT syntrex DOT com>
<15915798356 DOT 20011205152138 AT logos-m DOT ru> <3C0E1592 DOT BE4AA60 AT yahoo DOT com> <13918476397 DOT 20011205160616 AT logos-m DOT ru>

egor duda wrote:
> 
> Hi!
> 
> Wednesday, 05 December, 2001 Earnie Boyd earnie_boyd AT yahoo DOT com wrote:
> 
> EB> egor duda wrote:
> >> Wednesday, 05 December, 2001 Pavel Tsekov ptsekov AT syntrex DOT com wrote:
> >> SUSv2 mandates both <strings.h> and <string.h>
> 
> EB> Wrong documentation base.  You must use MSDN for MinGW.
> 
> why? i can understand this wrt w32api, but for c runtime?
> 
> correct me if i'm wrong, but i was thinking that mingw is basically a
> "portability toolkit" just like cygwin, with only difference that it
> doesn't possess "portability layer" and uses native dlls.
> 

The "runtime" is "MS VC RT.DLL" of course the file name is without the
spaces.

> that said, when i port some program that's written "portably" in the
> sense "complies with SUSv2", i suppose that it'd be ported without
> much fuss, if it doesn't use functions not provided by crtdll/msvcrt.
> 

Right, but the only headers that MinGW-runtime care about are the ones
described by MS.  MinGW has always been and will always be ANSI
compliant only.  Porting UNIX programs to Win32 is the point of Cygwin
not of MinGW.

> the problem with -mno-cygwin here is that afaics there's no easy way
> to prevent gcc from looking into standard places when it's looking for
> headers. with "true" native mingw gcc everything's ok. but when we use
> cygwin gcc with -mno-cygwin, and application includes <strings.h>, gcc
> will include cygwin's header. it'd give no warnings or errors until it
> comes to linking and we'll see a bunch of "__impure_ptr" undefined.
> 
> >> mingw declares strcasecmp() in <string.h> while SUSv2 says it should
> >> be in <strings.h>
> >>
> >> i believe mingw headers should be fixed/updated.
> 
> that is, if mingw doesn't really provide any of the functions declared
> in <strings.h> (a quick look at msvcrt/crtdll exports made me think it
> doesn't), it may just provide an empty one. it'd solve
> -mno-cygwin problems and won't break anything in mingw world.
> 
> EB> No, MinGW headers are correct according to MSDN.  Perhaps the problem
> EB> here is that strcasecmp doesn't exist in the MinGW world.
> 
> then it's not clear to me why it's declared in mingw's <string.h>
> 

Ok, I just looked.  It's in the string.h header and is provided from an
add-on library libmoldname.a (MSVCRT.DLL version).  I understand your
point Egor and will take this up further in the MinGW-dvlpr list.  These
add-ons from prior maintainers have stepped on me and the MinGW team
before.  The simplest fix for now is to just add a strings.h that simply
includes string.h.

Earnie.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019