Subject: lib/30391: fails in lib/libc/string/wcschr.c
To: None <,,>
From: Holger Weiss <>
List: netbsd-bugs
Date: 06/01/2005 14:17:00
>Number:         30391
>Category:       lib
>Synopsis: fails in lib/libc/string/wcschr.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 01 14:17:00 +0000 2005
>Originator:     Holger Weiss
>Release:        NetBSD 2.0_STABLE
Individual Network Berlin e.V.
System: NetBSD 2.0_STABLE NetBSD 2.0_STABLE (PANDORA) #11: Sun May 1 05:27:23 CEST 2005 i386
Architecture: i386
Machine: i386
	Compiling netbsd-2 source fails in lib/libc/string/wcschr.c,
revision (pull-up of 1.3):

/usr/build/tools/bin/i386--netbsdelf-gcc -O2 -pipe -DALL_STATE -DUSG_COMPAT -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wno-uninitialized -Wreturn-type -Wswitch -Wshadow  -Werror -D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT -I/usr/src/lib/libc/include -DHESIOD -DINET6 -DNLS -DYP -D__DBINTERFACE_PRIVATE -DI18NMODULE_MAJOR=4 -I/usr/src/libexec/ld.elf_so -I/usr/src/lib/libc/dlfcn -DCITRUS_ICONV -DWITH_RUNE -I/usr/src/lib/libc -DRESOLVSORT -I. -DPOSIX_MISTAKE -DPORTMAP -DFLOATING_POINT   -nostdinc -isystem /usr/build/dist/usr/include -c    /usr/src/lib/libc/string/wcschr.c -o wcschr.o.tmp
/usr/src/lib/libc/string/wcschr.c: In function `wcschr':
/usr/src/lib/libc/string/wcschr.c:47: warning: implicit declaration of function `__UNCONST'
/usr/src/lib/libc/string/wcschr.c:47: warning: return makes pointer from integer without a cast

*** Failed target:  wcschr.o

	cd /usr/src	# netbsd-2 as of 2005-06-01
	./ -U distribution
	Declaring __UNCONST as in lib/libc/stdio/vfprintf.c solves the
problem for me:

Index: wcschr.c
RCS file: /cvsroot/src/lib/libc/string/wcschr.c,v
retrieving revision
diff -u -r1.2.8.1 wcschr.c
--- wcschr.c	31 May 2005 21:13:11 -0000
+++ wcschr.c	1 Jun 2005 13:52:34 -0000
@@ -36,6 +36,18 @@
 #include <assert.h>
 #include <wchar.h>
+#ifdef lint
+static __inline void *__UNCONST __P((const void *));
+static __inline void *
+__UNCONST(const void *v)
+	/* LINTED */
+	return (void *) v;
+#define __UNCONST(v)	(void *)(v)
 wchar_t *
 wcschr(const wchar_t *p, wchar_t c)