<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 21, 2010, at 11:56 PM, Chandler Carruth wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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></blockquote><div><br></div></div><div>I'm not disagreeing with your ultimate decision here, but for the record, these *are* system headers; they're permitted to make assumptions about other system headers, it's just a porting burden to actually do so.</div><div><br></div><div>John.</div></body></html>