<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 22, 2014 at 1:48 PM, jahanian <span dir="ltr"><<a href="mailto:fjahanian@apple.com" target="_blank">fjahanian@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 style="word-wrap:break-word"><br><div><div class=""><div>On May 22, 2014, at 11:40 AM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:</div>
<br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Another problem with our current model is that we build a broken redeclaration chain (the local declaration is marked as being a redeclaration of the implicitly-declared builtin, which it isn't). This leads to other bugs; for instance:</div>

<div><br></div><div>void f() { int memcpy(void); } void g() { memcpy(0,0,0); }<br></div><div><br></div><div>... misses the "implicitly declaring library function" warning.</div></div></div></div></blockquote><div>
<br></div></div>Interesting point. Currently, we create a built-in declaration of “memcpy” and make local declaration as its redeclaration.</div><div>Should we just not create the implicit built-in declaration when user declaration is local? If we do this,</div>
<div>then the missing  warning you mentioned will come out (and my bug gets fixed). But, we will miss the warning </div><div>about "<font face="Menlo"><span style="font-size:11px">incompatible redeclaration of library function ‘memcpy’” on local “redeclaration”.</span></font></div>
<div><font face="Menlo"><span style="font-size:11px">Which, I think, is ok as it is no longer a redeclaration.</span></font></div><div><font face="Menlo"><span style="font-size:11px">Am I reading you correctly?</span></font></div>
</div></blockquote><div><br></div><div>I think we should still produce the "incompatible redeclaration of library function" warning. I think it'd be better if we didn't create the implicit built-in declaration at all, but I don't think it should matter whether the declaration is local. If I write a non-local declaration:</div>
<div><br></div><div>  int memcpy(void);</div><div><br></div><div>... I should not get a redecl chain for memcpy with two declarations with different parameter types.</div></div></div></div>