This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: implicit narrowing conversion.


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]