From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Philippe De Muyter" To: wilson@cygnus.com (Jim Wilson) 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 04:16:00 -0000 Message-id: <199804201116.NAA16527@mail.macqel.be> References: <199804171849.LAA08494@rtl.cygnus.com> X-SW-Source: 1998-04/msg00796.html > > We also need a prototype if the return convention for pointers and ints > are different (e.g. on some m68k systems : d0 for ints a0 for pointers) > > Good point. However, I think the same reasoning applies here. Either these > systems must already have appropriate declarations in the system headers, or > else the compiler must already be using a safe ABI (e.g. some m68k systems > return pointers in both a0 and d0 just to be safe). Otherwise, the compiler > that came with the system wouldn't work. The declarations provided are not necessarily in stdlib.h (especially when there is no stdlib.h :)), but can be in malloc.h e.g., or only in the man pages. > > Another reason for needing a prototype is when we take the address > of the function. > > Not clear what you mean. A prototype is certainly desirable, but it is not > obvious that it is required. I meant 'a declaration' but that was a side note. That happens in the support library for ObjC : one module takes the address of malloc, free and friends to initialize some structure fields. If malloc and friends are not declared before as being functions, the compilation fails. > > If there is a problem, then we certainly should fix it, but I don't believe > that defining __USE_FIXED_PROTOTYPES__ is a good solution. > > Jim > Perhaps could we put malloc and friends outside of __USE_FIXED_PROTOTYPES__ in the generated stdlib.h, even without a parameter list if a parameter list seems risky ?