Making voids work portably (was re: efopen.c)
Geoff Kuenning
geoff at desint.UUCP
Sun Oct 27 13:53:06 AEST 1985
In article <202 at l5.uucp> gnu at l5.uucp (John Gilmore) writes:
> If you write the code
>with void, it can be trivially made to work on systems without broken voids
>by adding COPTS='-Dvoid=int' to the Makefile -- without source changes.
>*That*'s portability...
Actually, the safest thing is to use VOID, not void, and use either
-DVOID=void or -DVOID=int on your cc line. I've used a compiler (Mark
Williams C-86) where voids had severe problems (e.g., the no-pointer-to-
void-functions bug), but the built-in preprocessor wouldn't let me use
-Dvoid=int because void was a keyword it knew! A quick edit fixed all that.
--
Geoff Kuenning
{hplabs,ihnp4}!trwrb!desint!geoff
More information about the Comp.lang.c
mailing list