kgeisel@nfsun.UUCP (kurt geisel) (08/22/88)
Is there any way to get Lattice C 4.1 to provide variable argument list support using the standard varargs.h/stdarg.h macros? +--------------------------------------------------------------------------+ | Kurt Geisel, Intelligent Technology Group, Inc. | | Bix: kgeisel | | ARPA: kgeisel%nfsun@uunet.uu.net US Snail: | | UUCP: uunet!nfsun!kgeisel 65 Lambeth Dr. | | Pittsburgh, PA 15241 | | If a rule fires and no one sees it, did it really fire? | +--------------------------------------------------------------------------+
dmg@ssc-vax.UUCP (David Geary) (08/23/88)
In article <296@nfsun.UUCP>, kgeisel@nfsun.UUCP (kurt geisel) writes: > > Is there any way to get Lattice C 4.1 to provide variable argument list > support using the standard varargs.h/stdarg.h macros? > Oops, forgot to mention one thing. Remember, that when C puts short and char values on the stack, they are automatically converted to int. Floats are automatically converted to double. Therefore, if you want to pass a float, say, to a variadic function, you must extract it off the stack as a double, and then cast it into a float. Ditto for char's and short's (meaning extract off stack as int's, and then cast). -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ David Geary, Boeing Aerospace, ~ ~ Seattle - "THE DRIZZLE CAPITAL OF THE WORLD" ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~