coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some problems with GNU-lib


From: Eric Blake
Subject: Re: Some problems with GNU-lib
Date: Mon, 11 Jul 2011 07:34:27 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11

[adding coreutils]

On 07/11/2011 04:22 AM, Joachim Schmitz wrote:
> Hi folks
> 
> While trying to port coreutils-8.12 to HP NonStop I found a couple problems.
> 
> Coreutils uses C99 features at many places,

and that is intentional.

> In yesno.c the C99 compiler complains about not having seen a prototype for 
> rpmatch(), so I added that right after the #include <stdlib.h>, which should 
> have provided that prototype, but apparently did not (and our 
> /usr/include/stdlib.h indeed does not, so it should be the one from gnulib, 
> shouldn't it?

Yes, the gnulib replacement <stdlib.h> should provide a declaration for
rpmatch().  If it is not, then perhaps we have a case where your system
headers have a circular inclusion pattern that we do not yet have a
split-inclusion-guard setup to handle, such that you are not getting the
complete system <stdlib.h> followed by the complete gnulib <stdlib.h>
replacements in the correct order.  Something's not working right if
yesno.c doesn't see rpmatch declared, but I'm not sure what additional
details to ask for about your system headers, nor exactly the best way
to fix the real problem here.

> 
> In regcomp.c the compiler complains about not having seen a prototype for 
> strcasecmp() so I've added an #include <strings.h>,

Yes, that fix is necessary, and I will go ahead and push it.

From 77e4a0d2c9358eced24027df259a0ee1d090f05c Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Mon, 11 Jul 2011 07:32:39 -0600
Subject: [PATCH] regex: avoid compiler warning

Although glibc leaks strcasecmp through <string.h>, this behavior
is not required by POSIX, and HP NonStop needs <strings.h>

* lib/regex.c (includes): Include <strings.h>, for use of
strcasecmp in regcomp.c.
Reported by Jachim Schmitz.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog   |    7 +++++++
 lib/regex.c |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 41e97e2..9f98405 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-11  Eric Blake  <address@hidden>
+
+       regex: avoid compiler warning
+       * lib/regex.c (includes): Include <strings.h>, for use of
+       strcasecmp in regcomp.c.
+       Reported by Jachim Schmitz.
+
 2011-07-09  Paul Eggert  <address@hidden>

        stdint: respect system's intmax_t if INTMAX_MAX
diff --git a/lib/regex.c b/lib/regex.c
index 210bf91..af47056 100644
--- a/lib/regex.c
+++ b/lib/regex.c
@@ -53,6 +53,7 @@
    GNU regex allows.  Include it before <regex.h>, which correctly
    #undefs RE_DUP_MAX and sets it to the right value.  */
 #include <limits.h>
+#include <strings.h>

 #include <regex.h>
 #include "regex_internal.h"
-- 
1.7.4.4


-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]