Given the following test case on OS X:
#include
#include
int main(int argc, const char * argv[])
{
char data1[8] = "foo";
char data2[16] = "helloworld";
// links and works
// char* ptr = stpcpy(data1, data1);
// links and works
// char* ptr = strncpy(data1, data2, sizeof(data1));
// doesn't link (Undefined symbols for architecture x86_64)
char* ptr = stpncpy(data1, data2, sizeof(data1));
printf("%s\\n", data1);
return 0;
}
I get the following:
# icc main.c
main.c(16): warning #42: operand types are incompatible ("int" and "char *")
char* ptr = stpncpy(data1, data2, sizeof(data1));
^
Undefined symbols for architecture x86_64:
"___builtin___stpncpy_chk", referenced from:
_main in icczDRt9N.o
ld: symbol(s) not found for architecture x86_64
The same code works fine under ICC for Linux. Since stpncpy is a part of libc, I'm assuming that this is a known bug in ICC for OS X?
stpncpy broken on OS X with icc version 12.1.5
Пожалуйста, обратитесь к странице Уведомление об оптимизации для более подробной информации относительно производительности и оптимизации в программных продуктах компании Intel.



