[comp.unix.ultrix] Fun with void under Ultrix

cks@white.toronto.edu (Chris Siebenmann) (08/18/89)

+ Script started on Thu Aug 17 22:24:12 1989
+ sneezy.white 2> cat test.c
+ foo()
+ {
+ 	void	*a = 0;
+ 	if (a)
+ 		printf("oops\n");
+ }
+ sneezy.white 3> cc -c -O test.c
+ "test.c", line 5: a undefined
+ sneezy.white 6> exit
+ script done on Thu Aug 17 22:24:41 1989

 I wouldn't mind cc not supporting void, but I get a tad bit annoyed
when it drops void declarations into the bitbucket without telling
anyone. I guess I'll just tell people to use gcc.

[Tested on both Ultrix 2.2 and 3.1]
-- 
	"I shall clasp my hands together and bow to the corners of the world."
			Number Ten Ox, "Bridge of Birds"
Chris Siebenmann		...!utgpu!{ncrcan,ontmoh!moore}!ziebmef!cks
cks@white.toronto.edu	     or ...!utgpu!{,csri!}cks

grr@cbmvax.UUCP (George Robbins) (08/20/89)

In article <89Aug17.222844edt.30797@snow.white.toronto.edu> cks@white.toronto.edu (Chris Siebenmann) writes:
> 
>  I wouldn't mind cc not supporting void, but I get a tad bit annoyed
> when it drops void declarations into the bitbucket without telling
> anyone. I guess I'll just tell people to use gcc.

I think this is a result of the Ultrix cc dating from the period when void
had been added with the meaning of "ignore the return of this function" or
"this function doesn't return anything".  The added notion of a pointer to
void being a universal pointer and other niggling details came later.

Of couse DEC should upgrade their compiler to support such new wave notions,
or do they expect to use vcc in place of the default compiler?  You did
file an SPR, right?

-- 
George Robbins - now working for,	uucp: {uunet|pyramid|rutgers}!cbmvax!grr
but no way officially representing	arpa: cbmvax!grr@uunet.uu.net
Commodore, Engineering Department	fone: 215-431-9255 (only by moonlite)

frank@croton.dec.com (Frank Wortner) (08/22/89)

In article <7712@cbmvax.UUCP>, grr@cbmvax.UUCP (George Robbins) writes:

> Of couse DEC should upgrade their compiler to support such new wave notions,
> or do they expect to use vcc in place of the default compiler?  You did
> file an SPR, right?

Well, since vcc generates fairly good code and is supplied gratis with VAX Ultrix,
I wouldn't think using it was such a terrible fate.   ;-)

						Frank

P.S.  Please *do* submit an SPR.

P.P.S.  As always, all opinions are my own, however, you can feel free to share them.

stuart@dtix.dt.navy.mil (Stuart Pearlman) (08/29/89)

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	<stuart@dtix.dt.navy.mil>
				Hadron, Inc. 
				9990 Lee Hway.
				Fairfax, VA 22030  (703) 359-6100