<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/129261>129261</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Should -Wwrite-strings be renamed to -fwrite-strings?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
alejandro-colomar
</td>
</tr>
</table>
<pre>
GCC bug: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119068>
Cc: @AaronBallman
-f flags are meant to change the meaning of code, while -W flags are meant to add diagnostics without changing the meaning of code.
-Wwrite-strings is an oddity, since it does change the meaning of code:
```c
alx@debian:~/tmp$ cat ws.c
int
main(void)
{
return _Generic(&*"", const char *: 0, char *: 1);
}
alx@debian:~/tmp$ gcc -Wall -Wextra -Wwrite-strings ws.c
alx@debian:~/tmp$ ./a.out; echo $?
0
alx@debian:~/tmp$ gcc -Wall -Wextra -Wno-write-strings ws.c
alx@debian:~/tmp$ ./a.out; echo $?
1
alx@debian:~/tmp$ clang -Weverything -Wwrite-strings ws.c -Wno-pre-c11-compat
alx@debian:~/tmp$ ./a.out; echo $?
0
alx@debian:~/tmp$ clang -Weverything -Wno-write-strings ws.c -Wno-pre-c11-compatalx@debian:~/tmp$ ./a.out; echo $?
1
```
Should we add -fwrite-strings, and keep -Wwrite-strings as a deprecated synonym?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0lM-OrDYTxZ-m2JRAptx0NwsWTM_HfYBvMcsrt10NvjF2yzbTd7LIs0fQk3-TzkiJEskSopB_5_hQLpWSHT1zB80TNM-FWvIUYqccf1PexFDq4MKsYnEO5q37cjrheRlB9gjyNOV8TSB7oAFoGLWuRr9UIY5Aw3kZf7TOKaAhTeH29byMlR4tyMEakM913Yr9EeT_QPQnvfF2olcx-Cfl3Kw8guhB9OUFL06NCVVknFn5jDmgnpQfGfN0r1k_YrigDoaBTnibrGMsXx7tVMagsWr0IWWrE95snsKS78SV84BZ3a2sbl5u0WYuU47WjwltQuUxGGPz26qcrNeMNqMJnD5zKd-BsBf3pUH0yn2HnTB8tsqD7H8CGvJ8BdqhVhlvqdJrKNZnEP2srAc6vgZrgNqVdHjakG3kvESPX7-w52g10BFoD9QD0bZOqINP24kjrnXZo9jKvyvUK1RuxMPzp9ZGrbF8Uc5h-cLfc1T4MaRfjP81owIaVBWWDPIJWU8BgXYgBxC9-NviPpT_on79-X9xyo-r9ivHtzzZ7eWB-ubqGrnUdV3qMF9V_m8CeWjocSIPPP3jhH5t43tX_38KizN44-26lZc_qK-tprzBH5ivf0pLJVRo-BpZq8wG05sP_m0GORSmk6aVrSq4qw87cWj2LTXF1DXc8v64F3TYNaQuB9PudGsEaabLkeSlsB0JagTRsW5kQ1TVtajNno9HlrUSrYCd4FlZVzn3Oq_jq7ApLdzV1NK-Lpw6s0vbfCTyfMPt63qXmuciduum8ryMCXbC2ZTTb5hss-PuPY2PRz0zRvZqZrPOpY8hyaFYous-TFibp-Vc6TADDavK-6O8xvCNdQYaNm8JaHg3_9rRzwEAAP__h5fYIA">