https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96527
Bug ID: 96527 Summary: __builtin_va_arg_pack_len produces error in documented sample code Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bruno at clisp dot org Target Milestone: --- Created attachment 49024 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49024&action=edit Test case The only documented example of __builtin_va_arg_pack_len, in https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Constructing-Calls.html , produces an error "invalid use of '__builtin_va_arg_pack_len ()'" when actually used. Test case foo.c is attached. GCC 5.5.0, 6.5.0, 7.5.0, 8.4.0, 9.3.0, 10.2.0 all produce an error: $ gcc -O2 -Wall -S foo.c foo.c: In function 'myopen': foo.c:7:7: error: invalid use of '__builtin_va_arg_pack_len ()' 7 | if (__builtin_va_arg_pack_len () > 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~