<div dir="ltr"><div><div><div>I think this is a trivial question, but I just don't know why.<br><br></div>When clang compile the following snippets, it complains that there is no definition for 'lstat'.<br><br>
#include <sys/types.h><br>#include <sys/stat.h><br>#include <unistd.h><br>#include <stdio.h><br>#include <assert.h><br><br>int main(int argc, char** argv) {<br> assert(argc > 1);<br> struct stat buf;<br>
stat(argv[1], &buf);<br> printf("%u\n", buf.st_mode);<br> lstat(argv[1], &buf);<br> printf("%u\n", buf.st_mode);<br> return 0;<br>}<br><br></div>However it compiles without any warnings when using gcc, and I can see the declaration of lstat in sys/stat.h.<br>
<br></div><div>Is it because the certain macro definition hides the declaration of lstat when compiling using clang?<br><br></div><div>The clang version is 3.4 svn186209 and I'm on an x86_64 machine running on Ubuntu 12.04 LTS.<br>
<br></div><div>Thanks,<br></div><div>Hongxu Chen<br></div><div><div><div><br><br></div></div></div></div>