typedef gripe

Geoff Kuenning geoff at desint.UUCP
Sun Oct 7 06:29:47 AEST 1984


>What's the correct answer?  I don't know.  Probably the best thing to do
>is avoid typedef'ing arrays completely.
>				Kee Hinckley

Amen!  Note that if the guy who typedef'ed jmp_buf had made it a struct, not
only would it have been more flexible, but the construct under discussion
("jmp_buf c, *cp;  cp = &c;") would have been perfectly legal.  Now, of
course, there are thousands of people out there who have been forced to write
code that assumes jmp_buf is an array, so fixing the typedef to be a struct
like it should have in the first place will break all that code.  *SIGH*.

(I was never too happy with the idea of typedef'ing something as a fixed-size
array, anyway.  Doesn't sit well with my hick notions of what a typedef out to
be.)
-- 
	Geoff Kuenning
	First Systems Corporation
	...!ihnp4!trwrb!desint!geoff



More information about the Comp.lang.c mailing list