This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
PACTH: Fix strpbrk for NULL return
- From: "H. J. Lu" <hjl at lucon dot org>
- To: GNU C Library <libc-alpha at sources dot redhat dot com>
- Date: Wed, 5 May 2004 08:14:48 -0700
- Subject: PACTH: Fix strpbrk for NULL return
Gcc 3.4 doesn't like
if (strpbrk (hw, "o") - hw != 4)
since strpbrk returns (void *). This patch fixes it.
H.J.
----
2004-05-05 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/i386/i486/bits/string.h (strpbrk): Cast return to
char *.
--- sysdeps/i386/i486/bits/string.h.char 2003-09-05 08:28:16.000000000 -0700
+++ sysdeps/i386/i486/bits/string.h 2004-05-04 23:26:51.000000000 -0700
@@ -1732,7 +1732,7 @@ __strspn_g (__const char *__s, __const c
#define strpbrk(s, accept) \
(__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
? ((accept)[0] == '\0' \
- ? ((void) (s), NULL) \
+ ? ((void) (s), (char *) NULL) \
: ((accept)[1] == '\0' \
? strchr ((s), (accept)[0]) \
: __strpbrk_cg ((s), (accept), strlen (accept)))) \