[Bug c++/62181] [C/C++] Expected new warning: "adding 'char' to a string does not append to the string" [-Wstring-plus-int]

webrown.cpp at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Aug 23 12:43:00 GMT 2016


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

Eric Gallager <egall at gwmail dot gwu.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egall at gwmail dot gwu.edu

W E Brown <webrown.cpp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |webrown.cpp at gmail dot com

--- Comment #3 from Eric Gallager <egall at gwmail dot gwu.edu> ---
I think a better fixit would be to suggest using strcat or strncat or strlcat
or something, since that actually appends to the string like the programmer
probably intended to do. Abusing array indexing like that just looks wrong.


More information about the Gcc-bugs mailing list