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/29739] -Wconversion produces invalid warnings.
Date: Mon, 06 Nov 2006 16:30:00 -0000	[thread overview]
Message-ID: <20061106163016.24407.qmail@sourceware.org> (raw)
In-Reply-To: <bug-29739-10172@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from lopezibanez at gmail dot com  2006-11-06 16:30 -------
(a bit more explanation won't hurt)

The GCC documentation says: 

-Wconversion: Warn if a prototype causes a type conversion that is different
from what would happen to the same argument in the absence of a prototype.

In your program, in the absence of prototype, d would be promoted to int, thus
the warning is correct. Wconversion is only useful for translating very old C
code to ANSI/ISO C.

Since this behaviour is not very useful in the present day, and Wconversion
also warns for unsigned i = -1, we are going to move the above behaviour to
Wtraditional-conversion and make Wconversion warn for implicit conversions that
may change a value. This is planned for GCC 4.3 .

For more info, please check http://gcc.gnu.org/wiki/Wcoercion and don't
hesitate to contact me. (That wiki page is work in progress, not definitive,
actually, it is a bit outdated). Testing and comments are welcome.


-- 


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


  parent reply	other threads:[~2006-11-06 16:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-06 13:47 [Bug c/29739] New: " jaco at kroon dot co dot za
2006-11-06 13:55 ` [Bug c/29739] " schwab at suse dot de
2006-11-06 16:30 ` lopezibanez at gmail dot com [this message]
2006-11-06 16:47 ` jaco at kroon dot co dot za
2006-11-06 17:45 ` pepster at users dot sourceforge dot net
2006-11-06 18:21 ` jaco at kroon dot co dot za
2006-11-06 18:49 ` pepster at users dot sourceforge dot net
2006-11-06 19:51 ` lopezibanez at gmail dot com
2006-11-06 20:34 ` pepster at users dot sourceforge dot net

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=20061106163016.24407.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).