
va_list is always black magic. it's often hard to track down an actual concrete definition.
va_list is always black magic. it's often hard to track down an actual concrete definition.
going back to the source
among the most embarrassing thing i've ever done in my life is ask david edelsohn a question i hadn't thoroughly researched first.
ok stumbled on a raymond chen article:
https://devblogs.microsoft.com/oldnewthing/20180817-00/?p=99515
and now i understand... it's not va_list precisely, it's that using va_list causes the function to spill the registers. in reality, we're supposed to provide space for potential arg saves for the callee, _then_ the function subtracts from r1 (which raymond chen also mentions). this mirrors what i see in the prolog of sprintf
@prozacchiwawa I’m sure he didn’t hold it against you.