This is the mail archive of the gcc-patches@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]

Re: PATCH: Wconversion-sign (try 4, I think)


Just to point out that this basically needs approval for the C++
front-end , since Joseph already said that C front-end changes were
OK.

Thanks,

Manuel.

PS: Perhaps, I will be able to finish the GSoC 2006 project before
starting the 2007 one. ;-)


On 21/03/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
:ADDPATCH diagnostics:

New version of the Wconversion-sign patch. See
http://gcc.gnu.org/ml/gcc-patches/2007-03/msg01217.html for more
details.

This version works as follows:

* For C, Wconversion enables Wconversion-sign unless
Wno-conversion-sign is given.
* For C++, Wconversion does not enable Wconversion-sign, it needs to
be requested explicitly.

Bootstrapped and regression tested.

OK for mainline?


2007-03-21 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.




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