[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 <[email protected]> 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 <[email protected]> --- 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 <[email protected]> + + 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 <[email protected]> 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 [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
