RE: Compiler code gen

"Jon Watte" <[email protected]> Tue, 30 Nov 2004 14:06:54 -0800
Newsgroups gmane.games.devel.windows
Message-ID <[email protected]>
> I guess his point is that va_arg(ap, float) as defined is always going to
do
> the wrong thing because variable argument lists can never contain floats.
I
> don't know how that could be fixed, considering that va_arg() is
essentially
> a macro hack created to avoid adding language constructs.

In C++, you could catch that use with a compile-time assert.

In both C and C++ you can actually pass floats by using unions, and/or
type punning. Thus, being able to specify float as the argument for
va_arg() isn't entirely useless -- but, as many things, may cause hole
in the feet of previously inexperienced programmers.

Corollary: experience is directly proportional to the number of holes
in your feet, thus more experienced programmers walk slower.

Cheers,

			/ h+



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=555