Here's something I've been wondering for a long time.
Consider the following simple example:
I've always used va_start(3) this way and I've always assumed that Lint doesn't know how to deal with it properly (or perhaps FreeBSD's implementation of stdarg(3) is somewhat iffy) so this warning can safely be ignored. But from time to time I keep wondering about this, so I figured perhaps someone here knows for sure. Any thoughts?
Consider the following simple example:
Code:
#include <stdarg.h>
#include <stdio.h>
void
function(const char *fmt,...)
{
va_list ap;
va_start(ap,fmt);
(void)printf(fmt,ap);
va_end(ap);
}
Code:
[cmd]lint -aabceghnsux foo.c[/cmd]
foo.c:
foo.c(9): warning: pointer casts may be troublesome [247]
[i][snip warnings about the standard library itself][/i]
Lint pass2: