https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116082

--- Comment #9 from Harald van Dijk <harald at gigawatt dot nl> ---
(In reply to Alejandro Colomar from comment #8)
> (In reply to Harald van Dijk from comment #7)
> > The warning is called -Wunterminated-string-initialization, but there is no
> > unterminated string. That is what this bug is about. If people want a
> > warning for truncated data, there should be a new warning for that, making
> > -Wunterminated-string-initialization do something other than what its name
> > clearly says it does is not the right way of handling that.
> 
> Not only there's no _unterminated string_; there's no _string_ at all.  That
> string literal is not a string.

That string literal is not a string, sure.

> So, if you're using a non-string to initialize a string, you deserve a
> diagnostic.

Including "so" does not actually make what you write follow from the preceding.

If you want to make the argument that there is no unterminated string because
there is no string in the first place, then the logical conclusion is still
that  -Wunterminated-string-initialization should not warn about that.

If you want a warning for something other than unterminated strings, that
should be a different warning, not -Wunterminated-string-initialization.

Reply via email to