This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: implicit narrowing conversion.
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: Adam Sulmicki <adam at cfar dot umd dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 23 Jun 2004 14:16:07 +0000 (UTC)
- Subject: Re: implicit narrowing conversion.
- References: <20040622134407.H55799-100000@www.missl.cs.umd.edu>
On Tue, 22 Jun 2004, Adam Sulmicki wrote:
> shouldn't this code below generate warnings on "implicit narrowing
> conversion", on:
> 1) "i=f" assignment as well as
> 2) on conversion on return from float to int?
The desire for a better -Wconversion has been known for years. I have a
notional specification for it, "warn for any implicit conversion that may
change a value", as discussed at
<http://www.srcf.ucam.org/~jsm28/gcc/#Wconversion>, arising from a
discussion on security-audit (there having been a spate of security
problems relating to implicit signed/unsigned conversions)
<http://archives.neohapsis.com/archives/linux/lsap/2000-q4/0153.html>, and
also discussed in bug 6614 and elsewhere. There are far more features
that would be nice to have than there is implementation time, and so far
no-one has contributed an implementation of this one.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)