Next: , Previous: , Up: The Macros  





Checks whether f(va_list va){ &va; } works as expected.

This macro uses compile-time detection and so is cross-compile ready.

C99 mentioned passing a pointer to va_list to other functions (footnote 212 of "7.15 Variable arguments <stdarg.h>"). However, f(va_list va) { &va; } produces broken pointer on some environments such as gcc on x86_64, although { va_list va; &va; } works as expected. See the detection code of this file and any of pages,, and for further information.

Although C99 does not define the operations f(va_list va) { &va; } and &va itself as standard (footnotes are declared as "normative part, information only"), certain situations need it. This macro provides a type detection about va_list implementation to deal with the operation.

Following workaround will probably work on such environments although it does not ensure to be safe and portable. At least it is working on x86_64-unknown-linux-gnu:

 f(va_list va)
   va_list *vap;
     vap = &va;
     vap = (va_list *)va;

Source Code

Download the latest version of ax_c_referenceable_passed_va_list.m4 or browse the macro’s revision history.


Copyright © 2008 YAMAMOTO Kengo

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.