Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!uxc.cso.uiuc.edu!tank!mimsy!dtix!stuart From: stuart@dtix.dt.navy.mil (Stuart Pearlman) Newsgroups: comp.unix.ultrix Subject: Re: Fun with void under Ultrix Message-ID: <703@dtix.dt.navy.mil> Date: 28 Aug 89 22:01:46 GMT References: <7712@cbmvax.UUCP> <1450@riscy.dec.com> Reply-To: stuart@dtix.dt.navy.mil (Stuart Pearlman) Organization: David Taylor Research Center, Bethesda, MD Lines: 40 Another problem with void under Ultrix (at least 2.0) is that you can't use void in a typedef. Script started on Mon Aug 28 17:25:54 1989 stuart@dtix[1/21]% cat t.c typedef void my_void; main() { extern my_void exit(); (my_void) printf("Hello World.\n"); exit(0); } stuart@dtix[1/22]% cc t.c -o t "t.c", line 1: void type for my_void stuart@dtix[1/23]% exit stuart@dtix[1/24]% script done on Mon Aug 28 17:26:32 1989 The reason I wanted to do this in the first place was to be able to declare functions such as exit() correctly both under Ultrix and on other systems where exit is declared (at least in the lint library) as returning an int. This code should lint on both systems without any warnings. # ifdef ultrix typedef void libc_void; # endif # ifdef INTEGER_EXIT_MACHINE typedef int libc_void; # endif extern libc_void exit(), perror(); -- Stuart Pearlman Hadron, Inc. 9990 Lee Hway. Fairfax, VA 22030 (703) 359-6100