On 12-03-2015 20:24, Jeff Squyres (jsquyres) wrote:
include <stdio.h>
#include <stdarg.h>
static void foo(const char *fmt, ...)
{
va_list list;
va_start(list, fmt);
vprintf(fmt, list);
va_end(fmt);
}
int main()
{
foo("%s %s\n", "hello", "world");
}
Thanks for the code, Jeff.
icc won't even compile it, barfs with the following error message:
===========================================
foo.c(9): error: incorrect use of va_end
va_end(fmt);
^
compilation aborted for foo.c (code 2)
===========================================
This means i should update icc, right ?
[ ]'s