This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]