[PATCH] D45383: Strip reference from a va_list object in C when merging parameter types.

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 9 11:38:19 PDT 2018


erichkeane added a comment.

In https://reviews.llvm.org/D45383#1062014, @efriedma wrote:

> > I don't see redeclaring the latter 3 as being disallowed,
>
> It is in fact disallowed by the standard, in the section describing va_start/va_arg/va_end/va_copy: "If a macro definition is suppressed in order to access an actual function, or a program defines an external identifier with the same name, the behavior is undefined."


The C spec seems to overload the usage of 'macro' a few times there.  I believe it is permissible to implement va_copy and va_end as a function, isn't it?  The first sentence of that section says va_start/va_arg must be implemented as "macros, not functions", but va_copy/va_end can be identifiers with external linkage.


Repository:
  rC Clang

https://reviews.llvm.org/D45383





More information about the cfe-commits mailing list