Martin Sebor <msebor at gcc dot> changed:

           What    |Removed                     |Added
      Known to fail|7.0                         |7.3.0, 8.0

--- Comment #10 from Martin Sebor <msebor at gcc dot> ---
GCC 8 issues a -Wrestrict warning for the test case in comment #0 but still no
-Wuninitialized.  I agree that issuing -Wuninitialized will be difficult
because (as noted in comment #5) the call is folded too early to tell whether
the argument is valid (either initialized or assigned to) prior to the call. 
The only way I can think of is to delay the folding until it is known and that
has not been a popular idea in the past.

$ cat pr60256.c && gcc -O2 -S -Wall pr60256.c
#include <string.h>
void f(void) {
  char* s;
  strcpy(s, s);
pr60256.c: In function ‘f’:
pr60256.c:4:3: warning: ‘strcpy’ source argument is the same as destination
   strcpy(s, s);

Reply via email to