This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs, does gcc fixincludes etc guarantee a stdlib.h exists?
- To: ghazi at caip dot rutgers dot edu
- Subject: Re: egcs, does gcc fixincludes etc guarantee a stdlib.h exists?
- From: Manfred Hollstein <manfred at s-direktnet dot de>
- Date: Mon, 30 Mar 1998 11:24:52 +0200 (MET DST)
- Cc: egcs at cygnus dot com
- References: <199803272118.QAA25896@caip.rutgers.edu> <13597.5567.26876.276804@saturn.s-direktnet.de>
- Reply-To: Manfred Hollstein <manfred at s-direktnet dot de>, Manfred dot Hollstein at ks dot sel dot alcatel dot de
On Sat, 28 March 1998, 16:25:27, manfred@s-direktnet.de wrote:
> On Fri, 27 March 1998, 16:18:24, ghazi@caip.rutgers.edu wrote:
>
> Simple question. Does gcc guarantee that after it diddles with
> the system headers that a stdlib.h exists in some form?
>
> Yes, it does. I have this situation on m68k-motorola-sysv. I've added
> a small patch recently, which guarantees the generated stdlib.h
> contains a definition for `size_t'. Otherwise, lots of g++ tests will fail.
>
> For target files which include tconfig.h, since we can't check
> autoconf macros, I'd like to hardwire including stdlib.h to possibly get
> prototypes for malloc, et al.
>
> I'll have to look on Monday, which prototypes are actually generated.
This is the generated one on the Motorola system:
#ifndef stdlib_h
#define stdlib_h
#define __need_size_t
#include <stddef.h>
#if defined(__USE_FIXED_PROTOTYPES__) || defined(__cplusplus) || defined (__STRICT_ANSI__)
extern void abort (void);
extern int abs (int);
extern int atexit (void (*) (void));
extern double atof (const char *);
extern int atoi (const char *);
extern long int atol (const char *);
extern void * bsearch (const void *, const void *, __SIZE_TYPE__ , __SIZE_TYPE__ , int (*) (const void *, const void *));
extern void * calloc (__SIZE_TYPE__ , __SIZE_TYPE__ );
extern void exit (int);
extern void free (void *);
extern char * getenv (const char *);
extern long int labs (long int);
extern void * malloc (__SIZE_TYPE__ );
extern int putenv (char *);
extern void qsort (void *, __SIZE_TYPE__ , __SIZE_TYPE__ , int (*) (const void *, const void *));
extern int rand (void);
extern void * realloc (void *, __SIZE_TYPE__ );
extern void srand (unsigned int);
extern double strtod (const char *, char **);
extern long int strtol (const char *, char **, int);
extern long unsigned int strtoul (const char *, char **, int);
extern int system (const char *);
#endif /* defined(__USE_FIXED_PROTOTYPES__) || ... */
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#endif /* stdlib_h */
manfred