public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Lisp2D <lisp2d@lisp2d.net>
Cc: gcc@gcc.gnu.org
Subject: Re: -Wconversion is very poor
Date: Wed, 23 Mar 2011 18:45:00 -0000	[thread overview]
Message-ID: <AANLkTimxOm-CYGLEcd16gdFdy9S+qf7733RQjqMZ_QCo@mail.gmail.com> (raw)
In-Reply-To: <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

      reply	other threads:[~2011-03-23 18:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23 18:37 Lisp2D
2011-03-23 18:45 ` Jonathan Wakely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimxOm-CYGLEcd16gdFdy9S+qf7733RQjqMZ_QCo@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=lisp2d@lisp2d.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).