On Thu, Aug 20, 2009 at 6:56 AM, erik quanstrom<quans...@quanstro.net> wrote: > and i wondered why kenc doesn't add an argument > count before the first vararg. (bwc pointed out > that the address following the last vararg would be > more useful.) va_* could be updated to deal with > the silent extra and abort on access beyond the end > of the actual variable arguments. a function to check > that list == end could added for the paranoid.
what problem are you trying to solve? the limit would check only that the right number of argument bytes are consumed, but not that they are interpreted correctly. print("%s %d", 1, "hello") would still crash, as would print("%s", 1, "hello"). #pragma varargck is more precise and can be done at compile time instead of needing to wait until the code trips at run time. russ