public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "lopezibanez at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/26167] -Wconversion fails to detect signedness conversion from int to unsigned int in fuction call
Date: Sat, 16 Sep 2006 01:08:00 -0000	[thread overview]
Message-ID: <20060916010809.31993.qmail@sourceware.org> (raw)
In-Reply-To: <bug-26167-12152@http.gcc.gnu.org/bugzilla/>



------- Comment #6 from lopezibanez at gmail dot com  2006-09-16 01:08 -------
In which way gcc reports the problem correctly? What gcc currently reports is
that if the prototype were missing the value would be passed as a signed int.
It is not warning you about the conversion, it warns you about the effect of
having a prototype.

If you mean that gcc (and g++) should warn that a signed variable is passed to
a function that expects an unsigned variable, then when using the -Wcoercion
flag (provided by the Wcoercion project [*]), both cc1 and cc1plus report:

pr26167.cpp:10: warning: coercion to 'unsigned int' from 'int' may alter its
value

[*] http://gcc.gnu.org/wiki/Wcoercion


-- 

lopezibanez at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lopezibanez at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26167


  parent reply	other threads:[~2006-09-16  1:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-08  1:10 [Bug c++/26167] New: " kristian dot hermansen at gmail dot com
2006-02-08 11:36 ` [Bug c++/26167] " rguenth at gcc dot gnu dot org
2006-02-08 14:46 ` mueller at gcc dot gnu dot org
2006-02-08 15:32 ` gdr at integrable-solutions dot net
2006-02-26  6:40 ` kristian dot hermansen at gmail dot com
2006-08-21  5:41 ` pinskia at gcc dot gnu dot org
2006-09-16  1:08 ` lopezibanez at gmail dot com [this message]
2006-09-17 18:37 ` kristian dot hermansen at gmail dot com
2006-09-17 18:39 ` kristian dot hermansen at gmail dot com
2006-09-17 20:31 ` tbm at cyrius dot com
2006-09-18  8:16 ` lopezibanez at gmail dot com
2006-09-18 12:11 ` mueller at gcc dot gnu dot org
2006-09-18 12:22 ` lopezibanez at gmail dot com
2006-09-18 12:45 ` lopezibanez at gmail dot com
2006-10-16 15:37 ` mueller at gcc dot gnu dot org
2006-11-24  1:51 ` manu at gcc dot gnu dot org
2006-11-24  1:56 ` manu at gcc dot gnu dot org

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=20060916010809.31993.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).