From: guy Date: Tue, 2 Jan 2001 22:33:04 +0000 (+0000) Subject: As GCC "2.96" notes, "`short int' is promoted to `int' when passed X-Git-Tag: tcpdump-3.5.1~14 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/3d6bd825eec79140483560eda4377278b1334ba2 As GCC "2.96" notes, "`short int' is promoted to `int' when passed through `...'", and therefore "...you should pass `int' not `short int' to `va_arg'". GCC "2.96" apparently fails to compile code that passes "short int" to "va_arg()", and Red Hat Linux 7.0 uses GCC "2.96", so we fix this, as per Pekka Savola's note. --- diff --git a/missing/snprintf.c b/missing/snprintf.c index 9683ecaf..bada4721 100644 --- a/missing/snprintf.c +++ b/missing/snprintf.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: snprintf.c,v 1.3 2000-01-10 16:57:44 fenner Exp $ */ +/* $Id: snprintf.c,v 1.4 2001-01-02 22:33:04 guy Exp $ */ #ifdef HAVE_CONFIG_H #include @@ -39,7 +39,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/missing/snprintf.c,v 1.3 2000-01-10 16:57:44 fenner Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/missing/snprintf.c,v 1.4 2001-01-02 22:33:04 guy Exp $"; #endif #include @@ -274,7 +274,7 @@ append_char(struct state *state, if (long_flag) \ res = (unsig long)va_arg(arg, unsig long); \ else if (short_flag) \ - res = (unsig short)va_arg(arg, unsig short); \ + res = (unsig short)va_arg(arg, unsig int); \ else \ res = (unsig int)va_arg(arg, unsig int)