Section F.6. Variable Argument Lists


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); 





UNIX to Linux Porting. A Comprehensive Reference
UNIX to Linux Porting: A Comprehensive Reference
ISBN: 0131871099
EAN: 2147483647
Year: 2004
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net