Fun with void under Ultrix

Stuart Pearlman stuart at dtix.dt.navy.mil
Tue Aug 29 08:01:46 AEST 1989


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 at dtix[1/21]% cat t.c
typedef void my_void;

main()
{
    extern my_void exit();

    (my_void) printf("Hello World.\n");
    exit(0);
}
stuart at dtix[1/22]% cc t.c -o t
"t.c", line 1: void type for my_void
stuart at dtix[1/23]% exit
stuart at 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	<stuart at dtix.dt.navy.mil>
				Hadron, Inc. 
				9990 Lee Hway.
				Fairfax, VA 22030  (703) 359-6100



More information about the Comp.unix.ultrix mailing list