[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 08:54:50 PDT 2018


erichkeane added a comment.

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

> Identical to what?  `__builtin_va_start` and `__builtin_va_end` specifically are weird because they're builtins which have a signature which can't be expressed in C.  vprintf doesn't have that problem.
>
> Builtins.def makes the relevant distinction already: a "BUILTIN" is a reserved identifier the user isn't allowed to redeclare, and a "LIBBUILTIN" is a library function which the compiler has special knowledge of.


In the context of this patch, vprintf is handled using the exact same code-paths.  SO, it'll have its 2nd parameter created with type 'char*&', which can cause the same crash that I observed with overloading va_end.  Currently, you ARE permitted to redeclare a BUILTIN (see my 1st test above), but a conflicting type is an error.  A LIBBUILTIN is a warning to have a conflicting redeclaration.


Repository:
  rC Clang

https://reviews.llvm.org/D45383





More information about the cfe-commits mailing list