In this function : void asm_push_args(const char *ins, va_list args) { va_...

George Chow Answered 2 answers
Question by George Chow 2 years ago

Question

In this function :
void asm_push_args(const char *ins, va_list args)
{
va_list args2; va_copy(args2, args);
vfprintf(stdout, ins, args);
fprintf(stdout, "\n");
if (current_process->ofile)
{
vfprintf(current_process->ofile, ins, args2);
fprintf(current_process->ofile, "\n");
}
}
The line after va_copy(args2, args); Should we use vfprintf(stdout, ins, args2) instead of vfprintf(stdout, ins, args)? I am not sure.

Answers

Answered by Daniel McCarthy

Instructor

Hello George,
I think either will be fine in this particular case though args2 is better
Thanks

Follow-up by George Chow

Question author

Got it. Thanks.