[Bug c++/80151] Add a warning to catch implicit string to bool conversion (-Wstring-conversion)
egallager at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Aug 23 07:44:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80151
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-08-23
CC| |egallager at gcc dot gnu.org
Ever confirmed|0 |1
Severity|normal |enhancement
--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
Confirming as an enhancement. After adding a missing semicolon to get it to
compile, there's only a warning from -Wunused-but-set-variable:
$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic -Wwrite-strings -Wconversion
-Wsign-conversion 80151.cc
80151.cc: In function ‘int main()’:
80151.cc:3:7: warning: variable ‘b’ set but not used
[-Wunused-but-set-variable]
bool b;
^
$
More information about the Gcc-bugs
mailing list