https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178
--- Comment #6 from Alejandro Colomar <alx at kernel dot org> --- (In reply to Jonathan Wakely from comment #5) > (In reply to Alejandro Colomar from comment #4) > > As for C++, maybe such an initialization should be acceptable as a GNU > > extension. > > Please, no. The C++ rule is a very deliberate language design choice. It > would not be a useful extension to directly contradict that unless users add > extra options to disable it again. Then I assume C++ doesn't have the [[gnu::nonstring]] attribute, and so this is not an issue in C++. Maybe you should diagnose when that attribute is used with -Wc++-compat, which would make it unnecessary to warn on the string initialization.