On Mon, 1 Jan 2001, Pekka Savola wrote:
> Hi,
>
> ---
> ./missing/snprintf.c: In function `xyzprintf':
> ./missing/snprintf.c:376: `short int' is promoted to `int' when passed
> through `...'
> ./missing/snprintf.c:376: (so you should pass `int' not `short int' to
> `va_arg')
> ./missing/snprintf.c:392: `short unsigned int' is promoted to `int' when
> passed through `...'
> ./missing/snprintf.c:402: `short unsigned int' is promoted to `int' when
> passed through `...'
> ./missing/snprintf.c:412: `short unsigned int' is promoted to `int' when
> passed through `...'
> ./missing/snprintf.c:422: `short unsigned int' is promoted to `int' when
> passed through `...'
> ---
>
> On Red Hat Linux 7, compile fails. Apparently this is caused by gcc
> "2.96" which is stricter about the correctness of the code. Other
> snprintf implementations, e.g. one in OpenSSH, compile fine.
>
> Anyone more intimate with missing/snprintf.c? It's such an essential
> function I wouldn't want just to make it work (compared to making it
> right).
Workaround:
snprintf.o was addded to LIBOBJS if any of the following was missing:
vsnprintf snprintf asprintf asnprintf vasprintf vasnprintf
However, there's zero point in this as the only one that has been used in
the code is snprintf.
I used the following patch to get rid of snprintf.o.
--
Pekka Savola "Tell me of difficulties surmounted,
Netcore Oy not those you stumble over and fall"
Systems. Networks. Security. -- Robert Jordan: A Crown of Swords
diff -uNr tcpdump/configure.in tcpdump.snprintf/configure.in
--- tcpdump/configure.in Sat Dec 9 04:58:47 2000
+++ tcpdump.snprintf/configure.in Mon Jan 1 01:36:19 2001
@@ -461,7 +461,7 @@
fi
needsnprintf=no
-AC_CHECK_FUNCS(vsnprintf snprintf asprintf asnprintf vasprintf vasnprintf,,
+AC_CHECK_FUNCS(vsnprintf snprintf,,
[needsnprintf=yes])
if test $needsnprintf = yes; then
LIBOBJS="$LIBOBJS snprintf.o"