http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52534
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-15
10:03:59 UTC ---
Because otherwise
void
foo (char a, ...)
{
__builtin_va_list va;
__builtin_va_start (va, a);
__builtin_va_end (va);
}
would not work (arg there is (int) a, as char is promoted to int).
IMHO if we want to diagnose this, it should be done in the C/C++ FEs, e.g.
for C FE perhaps in c_parser_postfix_expression_after_primary, by requiring
that
the second argument to __builtin_va_start is an identifier token, rathern than
a + 0 or similar.