This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: egcs, does gcc fixincludes etc guarantee a stdlib.h exists?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]