diff mbox

error: undefined identifier '__builtin_va_arg_pack'

Message ID 20130718084743.727666bc@tlielax.poochiereds.net (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Jeff Layton July 18, 2013, 12:47 p.m. UTC
I was running sparse on some code I maintain and saw a bunch of
warnings like this:

    /usr/include/bits/stdio2.h:98:25: error: undefined identifier '__builtin_va_arg_pack'
    /usr/include/bits/stdio2.h:98:25: error: not a function <noident>

It looks like gcc defines this in recent versions:

    http://gcc.gnu.org/onlinedocs/gcc/Constructing-Calls.html

It seems like something like this might do the trick for
__builtin_va_arg_pack_len:

-----------------[snip]------------------
-----------------[snip]------------------

...but I'm unclear on how best to fix the errors around
__builtin_va_arg_pack since it doesn't seem to return a well-defined
type.

Thanks...
diff mbox

Patch

diff --git a/lib.c b/lib.c
index 7e822eb..db981d8 100644
--- a/lib.c
+++ b/lib.c
@@ -779,6 +779,7 @@  void declare_builtin_functions(void)
 	add_pre_buffer("extern double __builtin_fabs(double);\n");
 	add_pre_buffer("extern void __sync_synchronize();\n");
 	add_pre_buffer("extern int __sync_bool_compare_and_swap(void *, ...);\n");
+	add_pre_buffer("extern size_t __builtin_va_arg_pack_len(void);\n");
 
 	/* Add Blackfin-specific stuff */
 	add_pre_buffer(