This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -Wconversion is very poor
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Lisp2D <lisp2d at lisp2d dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 23 Mar 2011 18:37:12 +0000
- Subject: Re: -Wconversion is very poor
- References: <31222297.post@talk.nabble.com>
On 23 March 2011 17:58, Lisp2D wrote:
>
> I've turned on all warnings to have clean program.
> Turn on -Wconversion but it will not care about BIG trouble in C++:
> conversion.
>
> class A{
> public:
> A(unsigned ? ? ?int){}
> };
>
> class B{
> public:
> B(A){}
> };
>
> B b(-1); //OK without warnings
> int ? ? main(void){}
>
> ----
> -1 => A(FF..FF) => B(FF..FF)
> I want to see all program like:
>
> B b(A(-1));
>
> Which warning I must to set?
Your question is inappropriate for this mailing list, questions about
using or building gcc should go to gcc-help@gcc.gnu.org
Please take any follow up question to that list, thanks.
As clearly documented in the manual, you need -Wsign-conversion in C++
http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/Warning-Options.html#index-Wconversion-368