From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Wilson To: "Philippe De Muyter" Cc: ghazi@caip.rutgers.edu, bothner@cygnus.com, egcs@cygnus.com, law@cygnus.com Subject: Re: egcs, does gcc fixincludes etc guarantee a stdlib.h exists? Date: Mon, 20 Apr 1998 22:16:00 -0000 Message-id: <199804210222.TAA01907@rtl.cygnus.com> References: <199804171541.RAA09891@mail.macqel.be> X-SW-Source: 1998-04/msg00833.html Alternatively, we could put malloc, realloc, calloc and free outside of __USE_FIXED_PROTOTYPES__ in the generated stdlib.h. I have been trying to discourage you from fixing this problem in stdlib.h because I believe it is unsafe to put stuff there by default. I just remembered another problem. There exist many programs which have their own declarations of these C library functions. Some of them them have wrong definitions. Some of them have definitions which are not valid POSIX, but which agree with the system's man pages. There may also be declarations in the system header files in other files which are not POSIX. If we add our own POSIX declarations to stdlib.h, we run the risk that some programs won't compile with gcc anymore. Dealing with all of these bug reports will be a hassle, and I would rather not have them in the first place. free incidentally is not entirely safe, because many older systems define it as returning int, whereas ISO C says it returns void. I can see that the Objective C runtime library is a problem. However, it looks like they already have a fix for it there. objc/misc.c defines __USE_FIXED_PROTOTYPES__ itself. That at least limits the damage to the Objective C runtime library. If the target system has POSIX incompatibilities, then the Objective C runtime may fail to work, but at least C programs will still work. Jim