bsd-snprintf [was: openssh-2.1.1p1 on Irix6.2 report]
Sven Mascheck
mascheck at faw.uni-ulm.de
Wed Jun 28 01:16:48 EST 2000
Hi,
> ** There seems to be a pointer problem in vsnprintf:
>
> cc -[...] -DHAVE_CONFIG_H -c bsd-snprintf.c
> "bsd-snprintf.c", line 149: warning(1164): argument of type "va_list *" is
> incompatible with parameter of type "char *"
> ret = vsprintf(p, fmt, ap);
> ^
Yes, such a problem might occur on all platforms that don't come with
[v]snprintf(). Wether it does compile depends on the compiler and the
actual type of va_list. It's a struct on some platforms and just a
void* (or char* resp.) on others.
It doesn't compile on OSF1/V4.0 (gcc-2.7.2.1) but does so on Solaris 2.5
(gcc-2.7.2.3 / -2.95.2). I haven't tried on other dialects, that don't
come with [v]snprintf().
Thus i also was wondering, why the 'argument list' (both in the
declaration and implementation) contain a "va_list*", not just "va_list".
All other Unix dialects that come with snprintf() (including old ones)
- and particularly C99 - declare vsnprintf() with just "va_list".
Again, on Solaris2.5, this doens't harm too much, as there's much
implicit casting with void* pointers. This might be another reason,
why it was not that important yet. On Irix6.x it might be
Is there a reason, why bsd-snprintf.c/h is different then?
Sven
--
More information about the openssh-unix-dev
mailing list