3 ms·
Clang 3.5 compiles that for me without warnings even with -Weverything. String literals in C (but not C++) aren't const for legacy reasons despite not being mod
by plorkyeran 12y ago
Clang 3.5 compiles that for me without warnings even with -Weverything. String literals in C (but not C++) aren't const for legacy reasons despite not being modifiable.
- andrewchambers 12y agoSorry, I made a mistake. I think it is: static char s[] = * &"foo"; The c standard says char array initializers are either a string, or a string surrounded by optional '{}' .
- plorkyeran 12y ago-pedantic gives "warning: array initialized from parenthesized string constant" for that, so I'm guessing it's an unintended consequence of a nonstandard extension. Might be worth reporting since at the minimum the warning is wrong.