[cfe-dev] __builtin_va_list different on targets

John McCall rjmccall at apple.com
Mon May 23 00:57:55 PDT 2011


On May 23, 2011, at 12:43 AM, Wenhan Gu wrote:
> Thanks for your answer very much.
> 
> I wonder for what reason does ARM use void * but X86 use char * ?
> Seems ARM uses void * since its spec said that.
> But X86? I cannot find any reason or spec to specify why X86 uses char *, not void * directly?

It's just what GCC specifies.  void* was introduced by C89, and GCC
predates that, so it's likely that it's still char* for really, really historical
reasons.  At this point it can't be changed.

It's not specified by Intel or anything, so it's quite possible that there
are other x86 implementations (that don't strive for ABI compatibility
with GCC) that uses a different type.  For example, I don't know for
certain whether anyone's verified that MSVC uses char* for va_list.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110523/561a96ab/attachment.html>


More information about the cfe-dev mailing list