libiberty requirements and ISO C90
Mark Kettenis
mark.kettenis@xs4all.nl
Tue May 17 22:16:00 GMT 2005
From: Ian Lance Taylor <ian@airs.com>
Date: 15 May 2005 23:20:14 -0400
Well, we require an ISO C90 compiler; do we require ISO C90 libraries?
If we require the libraries, then we can remove a number of files from
libiberty, at least atexit.c, memchr.c, memcmp.c, memcpy.c, memmove.c,
memset.c, snprintf.c, strchr.c, strerror.c, strncmp.c, strrchr.c,
strtol.c, strtoul.c, vfprintf.c, vsprintf.c. If we don't require the
libraries, then we can't assume that <string.h> declares strerror. In
fact, technically we can't even assume that <string.h> exists,
although we do currently have a few cases where it is included without
being protected by #ifdef HAVE_STRING_H.
Hmm, it seems that snprintf() wasn't in ISO C90 since it's mentioned
as a new addition in ISO C99 according to google. At least HP-UX
10.20 doesn't have it. And GDB still builds on vax-dec-ultrix4.0 for
which I'm not sure that it has a full ISO C90 library. So I hope
you're not seriously proposing to remove these functions from
libiberty.
Mark
More information about the Gcc
mailing list