2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 19 May 2007 13:32:03 +0000 (13:32 +0000)
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 19 May 2007 13:32:03 +0000 (13:32 +0000)
commit7ee0d2277e23c2e52f6d6929708039e4aac9b153
tree98d10e457cbf659848ab680b6b1b3e192890e140
parentdf3d6232299393f4c995d54e13ae47611bc8d823
2007-05-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

* doc/invoke.texi (Warning Options): Add -Wconversion-sign.
(Wconversion): Update description.
(Wconversion-sign): New.
* c.opt (Wconversion-sign): New.
* c-opts.c (c_common_post_options): Uninitialized Wconversion-sign
means disabled for C++. Otherwise, take the status of Wconversion.
* c-common.c (conversion_warning): Warn with either Wconversion or
Wconversion-sign.
(warnings_for_convert_and_check): Conditions are already checked by
conversion_warning.
(convert_and_check): Don't check warnings if the conversion failed.

cp/
* cvt.c (cp_convert_and_check): Don't check warnings if the
conversion failed.

testsuite/
* gcc.dg/Wconversion-integer.c: Group testcases and add more.
* gcc.dg/Wconversion-sign.c: New.
* gcc.dg/Wconversion-integer-no-sign.c: New.
* g++.dg/warn/Wconversion-integer.C: Move some warnings to
Wconversion-sign.C
* g++.dg/warn/Wconversion-sign.C: New.
* g++.old-deja/g++.other/warn4.C: Update.
* g++.dg/warn/Wconversion1.C: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124856 138bc75d-0d04-0410-961f-82ee72b054a4
15 files changed:
gcc/ChangeLog
gcc/c-common.c
gcc/c-opts.c
gcc/c.opt
gcc/cp/ChangeLog
gcc/cp/cvt.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wconversion-integer.C
gcc/testsuite/g++.dg/warn/Wconversion1.C
gcc/testsuite/g++.dg/warn/Wsign-conversion.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/warn4.C
gcc/testsuite/gcc.dg/Wconversion-integer-no-sign.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wconversion-integer.c
gcc/testsuite/gcc.dg/Wsign-conversion.c [new file with mode: 0644]