<div dir="ltr">I can confirm this behavior change between 3.6 and 3.7.0.  gcc-4.9 and 5.2.1 behave the same way as clang-3.6.  </div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 25, 2016 at 5:26 AM, Aleksander Alekseev via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello<br>
<br>
Here is a test program:<br>
<br>
```<br>
#include <string.h><br>
<br>
int main()<br>
{<br>
  (void)strlcpy;<br>
  return 0;<br>
}<br>
```<br>
<br>
When I compile it using clang 3.6 compiler reports an error:<br>
<br>
```<br>
$ /usr/bin/clang-3.6 str.c -o str<br>
str.c:5:9: error: use of undeclared identifier 'strlcpy'; did you mean<br>
'struct'?<br>
<br>
str.c:5:9: error: expected expression<br>
2 errors generated.<br>
```<br>
<br>
Its OK, this is an expected behavior.<br>
<br>
But newer versions of CLang somehow manage to build this program:<br>
<br>
```<br>
$ /usr/local/bin/clang-3.7 str.c -o str<br>
<br>
str.c:5:9: warning: implicitly declaring library function 'strlcpy'<br>
with type 'unsigned long (char *, const char *, unsigned<br>
long)'<br>
<br>
str.c:5:9: note: include the header <string.h> or explicitly provide a<br>
declaration for 'strlcpy'<br>
<br>
1 warning generated.<br>
<br>
$ ./str<br>
<br>
$ /usr/local/bin/clang-3.8 str.c -o str<br>
<br>
str.c:5:9: warning: implicitly declaring library function 'strlcpy'<br>
with type 'unsigned long (char *, const char *, unsigned<br>
long)' [-Wimplicit-function-declaration]<br>
<br>
str.c:5:9: note: include the header <string.h> or explicitly provide a<br>
declaration for 'strlcpy' 1 warning generated.<br>
```<br>
<br>
First of all <string.h> is already included. Also there is no strlcpy<br>
procedure on this system at all (Ubuntu Linux 14.04 x64). Thus this<br>
program should not compile.<br>
<br>
It seems to be a serious bug since projects that use Autotools rely on<br>
clang 3.6 behaviour while checking weather current system has strlcpy<br>
procedure.<br>
<br>
Or maybe I just don't understand something?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Best regards,<br>
Aleksander Alekseev<br>
<a href="http://eax.me/" rel="noreferrer" target="_blank">http://eax.me/</a><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">-Brian</div>
</div>