libiberty tweek

Richard Henderson rth@cygnus.com
Wed Jul 14 17:31:00 GMT 1999


Some bits for minor warnings, primarily about string.h related
functions, due to lack of proper declarations.


r~


        * argv.c: Include stdlib.h and string.h instead of
        prototyping directly.
        * choose-temp.c: Conditionally include string.h.

Index: argv.c
===================================================================
RCS file: /cvs/cvsfiles/devo/libiberty/argv.c,v
retrieving revision 1.19
diff -c -p -d -r1.19 argv.c
*** argv.c	1999/01/15 06:35:25	1.19
--- argv.c	1999/07/15 00:27:18
*************** Boston, MA 02111-1307, USA.  */
*** 35,46 ****
  #ifdef __STDC__
  
  #include <stddef.h>
! extern void *memcpy (void *s1, const void *s2, size_t n);	/* 4.11.2.1 */
! extern size_t strlen (const char *s);				/* 4.11.6.3 */
! extern void *malloc (size_t size);				/* 4.10.3.3 */
! extern void *realloc (void *ptr, size_t size);			/* 4.10.3.4 */
! extern void free (void *ptr);					/* 4.10.3.2 */
! extern char *strdup (const char *s);				/* Non-ANSI */
  
  #else	/* !__STDC__ */
  
--- 35,42 ----
  #ifdef __STDC__
  
  #include <stddef.h>
! #include <string.h>
! #include <stdlib.h>
  
  #else	/* !__STDC__ */
  
Index: choose-temp.c
===================================================================
RCS file: /cvs/cvsfiles/devo/libiberty/choose-temp.c,v
retrieving revision 1.17
diff -c -p -d -r1.17 choose-temp.c
*** choose-temp.c	1999/05/06 23:40:20	1.17
--- choose-temp.c	1999/07/15 00:27:18
*************** Boston, MA 02111-1307, USA.  */
*** 34,39 ****
--- 34,42 ----
  #ifdef HAVE_STDLIB_H
  #include <stdlib.h>
  #endif
+ #ifdef HAVE_STRING_H
+ #include <string.h>
+ #endif
  #ifdef HAVE_SYS_FILE_H
  #include <sys/file.h>   /* May get R_OK, etc. on some systems.  */
  #endif


More information about the Gcc-patches mailing list