UNIX to Linux Porting: A Comprehensive Reference

F.6. Variable Argument Lists

Normally, C application programs do not need to know how variable argument lists are implemented. Some code might, however, use nonportable assignments, which will fail on Linux for zSeries.

Linux for zSeries implements the va_list type as a struct. Therefore, a normal assignment such as va2 = va1, as shown in the following code snippet, will not work:

va_list va1, va2; va_start (va1); va2 = va1; /* This assignment will not work. */

Instead, use the __va_copy() macro for copying, as follows:

__va_copy (va2, va1);

Категории