Thanks for your answer very much.<div><br></div><div>I wonder for what reason does ARM use <b>void *</b> but X86 use <b>char *</b> ?</div><div>Seems ARM uses void * since its spec said that.</div><div>But X86? I cannot find any reason or spec to specify why X86 uses char *, not void * directly?</div>
<div><br></div><div>Could anyone give me some hints?</div><div>Thanks a lot.</div><div><br><div class="gmail_quote">2011/5/23 John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div><div class="im"><div>On May 22, 2011, at 8:49 PM, Wenhan Gu wrote:</div><blockquote type="cite">
<div>I know __builtin_va_list is target-specific, and</div><div>ARM has <span style="color:rgb(0, 32, 128);font-family:Fixed, monospace;font-size:13px;white-space:pre-wrap">typedef void* __builtin_va_list;</span></div>
<div><font color="#002080" face="Fixed, monospace"><span style="white-space:pre-wrap"><span style="font-family:arial;white-space:normal">X86 has <span style="color:rgb(0, 32, 128);font-family:Fixed, monospace;font-size:13px;white-space:pre-wrap">typedef char* __builtin_va_list;</span></span><br>

</span></font><br></div><div>It seems they can be treated as the same prototype,i.e.. void*, at the header level.</div><div>What I want to ask is:</div><div>
<br></div><div>If I write a program use "typedef <b><font color="#ff0000">void</font></b>* __builtin_va_list" on X86, and run it.</div><div>Would I face any problem on run-time?</div></blockquote><div><br></div>
</div>C guarantees that void* and char* have compatible representations, so</div><div>as long that's the only difference, you won't have runtime problems.</div><div>You can obviously have compile-time problems, though:  for example,</div>
<div>in C, if va_list is a void*, then it can be implicitly converted to any pointer</div><div>type instead of (as with char*) only explicitly converted;  and in C++, you</div><div>can get different manglings, which is actually how we found out that our</div>
<div>ARM target was misdeclaring it.  But otherwise it should be fine, as long</div><div>as that's the only difference.</div><div><br></div><div>However, other targets may have more complicated differences than</div><div>
just void* vs. char*.</div><div><br></div><font color="#888888"><div>John.</div></font></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Wen-Han<br>
</div>