[Bug c/60256] No -Wuninitialized warning for strcpy
chengniansun at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Feb 18 01:15:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
--- Comment #1 from Chengnian Sun <chengniansun at gmail dot com> ---
If the call is to a user-defined function, then gcc warns. I cannot see why
"strcpy" is special.
$: cat s.c
extern void p(const char*);
void f(void) {
char* s;
p(s);
}
$: gcc-trunk -Wuninitialized s.c -c
s.c: In function ‘f’:
s.c:4:3: warning: ‘s’ is used uninitialized in this function [-Wuninitialized]
p(s);
^
More information about the Gcc-bugs
mailing list