Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!ima!ISM780B!jim From: jim@ISM780B.UUCP Newsgroups: net.lang.c Subject: Re: varargs.h Message-ID: <148@ISM780B.UUCP> Date: Mon, 25-Feb-85 01:29:59 EST Article-I.D.: ISM780B.148 Posted: Mon Feb 25 01:29:59 1985 Date-Received: Wed, 27-Feb-85 07:39:15 EST Lines: 20 Nf-ID: #R:denelvx:-100:ISM780B:25500109:000:1048 Nf-From: ISM780B!jim Feb 23 21:48:00 1985 >/* Written 4:19 am Feb 23, 1985 by ark@alice in ISM780B:net.lang.c */ >As the author of varargs, I would like to set the record straight. > >The intention of varargs was that the type given to va_arg >should only be a type that is meaningful as a parameter. Thus >char, short, and float are never meaningful because they >are automatically widened to int, int, and double respectively. >/* End of text from ISM780B:net.lang.c */ There is nothing in the language that says that parameters cannot be declared as char, short, or float. And if typeof is (should be!) added to the language, this will become all the more important. Since sizeof is a compile-time constant, there is no reason why va_arg cannot widen appropriately via ?: . Of course, you will want an ifdef lint version to avoid all the "constant used in a conditional context" messages. And speaking of lint, someone should fix it so it does not do type checking against VARARGS parameters (or maybe we need a /*VARTYPE*/ comment?) -- Jim Balter, INTERACTIVE Systems (ima!jim)