[libav-bugs] [Bug 712] Unchecked conversion from double to enum

bugzilla at libav.org bugzilla at libav.org
Wed Jul 30 12:32:05 CEST 2014


https://bugzilla.libav.org/show_bug.cgi?id=712

Diego Biurrun <diego at biurrun.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #3 from Diego Biurrun <diego at biurrun.de> 2014-07-30 12:32:05 CEST ---
(In reply to comment #2)
> Asked someone who knows C a bit better than me, and he also was of the opinion
> that the compiler is buggy and/or rejects valid code. He was giving the
> following citations are from C99 (pasted from an IRC conversion):
> 
> <dalias> per 6.2.5 p16, enumerated types are integer types
> <dalias> 6.3.1.4 p1 specifies what happens when a floating type is converted to
> an integer type
> <dalias> 6.5.16.1 p1 and p2 govern how this applies to the assignment operator
> <dalias> wm4, 6.5.2.2 p2 says that the constraint on the arguments is that they
> shall have a type that can be assigned to the type of the parameter
> <dalias> wm4, so it defers to the paragraph i already gave you about assignment
> 
> So it seems this code is valid.
> 
> There's a patch on the mailing list to remove this code, which will probably
> make it in, but I'm writing this so that you can avoid creating a compiler
> which invents its own C semantics. (Happened to clang a few times.)

Good old Rich Felker :)

Thanks for following up, but I think I will just push the removal of that
statement.  A debug printf is just not worth fussing over IMO.  If it makes the
lives of those testers easier, killing it makes sense.

-- 
Configure bugmail: https://bugzilla.libav.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the libav-bugs mailing list