On Wednesday 2014-05-07 02:59, Cristian Rodríguez wrote:
Ok, let me throw in another example ..
#include <stdio.h> char *strcpy(char *dest, const char *src);
int main(void) { char c[3]; strcpy(c, "fuuuuuuuuuuuuuuuuuuuuuuuuuckme"); printf("%s", c); return 0; }
This is valid but obviously buggy on purpose..
with <string.h> included I get the obvious warning..
In function ‘strcpy’, inlined from ‘main’ at c.c:10:5: /usr/include/bits/string3.h:104:3: warning: call to __builtin___memcpy_chk will always overflow destination buffer return __builtin___strcpy_chk (__dest, __src, __bos (__dest));
No <string.h> and the compiler is silent though the program still crashes. this is more in line with the actual concern I have.
So, force inclusion of string.h into all compiled files. There's -include you can put into CFLAGS. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org