<div class="gmail_quote">On Thu, Nov 18, 2010 at 4:00 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Thu, Nov 18, 2010 at 3:23 PM, dalej <span dir="ltr"><<a href="mailto:dalej@apple.com" target="_blank">dalej@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>Given that we're hacking around this header file bug in the compiler, don't we have to allow the reverse ordering anyway?</div><div>#include <stddef.h></div><div>extern void* malloc(size_t);</div><div>
#include <stdlib.h></div>
</blockquote><div><br></div></div><div>I think so, but I worry about further hacks. =[ Seems likely we have no choice.</div></div></blockquote><div><br></div><div>For reference, I'm now convinced this isn't a good idea. GCC actually rejects the construct you propose, and POSIX is pretty clear that this type of redeclaring isn't allowed: 'malloc' is in its reserved set of identifiers that can be implemented via function-like macros. Clang shouldn't get *more* lax than GCC here, and we don't want to start forward declaring these functions.</div>
<div><br></div><div>I'm going to revert my change to mm_malloc.h, and use __STDC_HOSTED__ to guard our only inclusion of it. I'm also going to temporarily remove it from the regression test suite while I discuss w/ Clang devs in general whether the un-hosted requirement for the test suite is going to remain feasible. Sorry again for the noise here. =[</div>
</div>