https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
Martin Sebor changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
Martin Sebor changed:
What|Removed |Added
See Also||https://gcc.gnu.org/bugzill
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
Martin Sebor changed:
What|Removed |Added
Known to fail|7.0 |7.3.0, 8.0
--- Comment #10 from Martin Se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
--- Comment #9 from Martin Sebor ---
Thanks for the reference. The strcmp(s, s) (and likewise memcmp(p, p, n)) case
in bug 65452 is different because unlike this one, strcmp doesn't change the
arrays pointed to by its arguments (which are also n
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
--- Comment #8 from Marek Polacek ---
For strcpy(s, s) see Bug 65452, which also contains a patch for
-Wsame-arguments.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
Martin Sebor changed:
What|Removed |Added
Keywords||diagnostic
Status|UNCONFIRMED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
--- Comment #6 from Manuel López-Ibáñez ---
(In reply to Marek Polacek from comment #5)
> We call c_fully_fold on strcpy (s, s);, and because this CALL_EXPR is
> tcc_vl_exp, we call fold () on it. fold () then via fold_call_expr -> ...
> calls f
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
--- Comment #5 from Marek Polacek ---
We call c_fully_fold on strcpy (s, s);, and because this CALL_EXPR is
tcc_vl_exp, we call fold () on it. fold () then via fold_call_expr -> ...
calls fold_builtin_strcpy and that hits
/* If SRC and DEST ar
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
Manuel López-Ibáñez changed:
What|Removed |Added
CC||manu at gcc dot gnu.org
--- Comment
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
Marek Polacek changed:
What|Removed |Added
CC||mpolacek at gcc dot gnu.org
--- Comment #
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
--- Comment #2 from Andrew Pinski ---
Well that is because strcpy(s,s) is optimized away as it is a nop.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
--- Comment #1 from Chengnian Sun ---
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
12 matches
Mail list logo