typedef void t; int f(t); ?

Paul Eggert eggert at ata.twinsun.com
Fri Sep 14 11:29:09 AEST 1990


Is the following a conforming ANSI C program?

	typedef void t;
	int f(t);
	int f(t) { return 0; }

3.5.4.3 (page 68 line 37) seems to say that line 2 is bad, because it mentions
the keyword `void' without talking about types.  But 3.7.1 (page 83 line 6)
seems to say that line 3 is OK, because it talks about the void type.  Surely
lines 2 and 3 are both OK, or both bad.


While we're on the subject, what about qualified voids?

	int g(volatile void) { return 0; }
	typedef volatile void c;
	int g(c);



More information about the Comp.std.c mailing list