Coda File System

Non-portable use of va_arg in RLE_Unpack (vice/codaproc2.cc)

From: Troy Benjegerdes <hozer_at_drgw.net>
Date: Fri, 9 Jul 1999 17:15:04 -0500 (CDT)
In the following function:

static void RLE_Unpack(int dummy1, int dummy2, PARM **ptr, ARG *ArgTypes
...)

va_arg() is used in an incorrect and non-portable way that breaks on
PowerPC, (and maybe alpha??) since the arguments to a varargs function
are actually stored on two different areas on the stack. One needs to use
va_arg() to get *each* argument, making the use of args++ in the for loop
incorrect.

Now, a second question: What is the reason for the 'dummy1' and 'dummy2'
arguments??

--------------------------------------------------------------------------
| Troy Benjegerdes    |       troy_at_microux.com     |    hozer_at_drgw.net   |
|    Unix is user friendly... You just have to be friendly to it first.  |
| This message composed with 100% free software.    http://www.gnu.org   |
--------------------------------------------------------------------------
Received on 1999-07-11 13:56:46