1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 09:32:40 +00:00
mpv/waftools
wm4 74b8223da6 build: switch to -std=c99 for saner float semantics
This fixes a weird bug with aspect ratio handling. It has to do with
float handling: with -std=gnu99, gcc implicitly enables broken non-
standard semantics giving float variables excess precision. This can for
example make this fail in theory: "float a = 0.1; assert(a == a);"

While standard C allows excess precision _within_ expressions, it
requires truncation when storing float values in variables of types
"float" or "double". The "gnu99" mode breaks this. It can be unbroken by
using "c99", or by specifying -fexcess-precision=standard. The former
seems less likely to break compilers other than modern gcc. Note that
-ffloat-store would also fix this, but also makes float expressions less
efficient and less precise for no reason.

The code that mistakenly fails because of this is dec_video.c line 393.
It caused the container aspect to be ignored in some or all situations,
depending how the compiler optimizes. For example, on gcc-4.6 with -Os,
the aspect is always ignored.

In future, we should probably just get rid of storing aspects as floats.
2014-02-02 00:00:14 +01:00
..
checks Detect Lua on FreeBSD 2014-01-15 00:18:14 +01:00
detections build: switch to -std=c99 for saner float semantics 2014-02-02 00:00:14 +01:00
fragments build: fix cocoa configure check on OS X 10.7 2014-01-02 20:42:03 +01:00
generators waf: try to fix unicode/byte string messup 2014-01-21 21:41:53 +01:00
__init__.py
dependencies.py build: make deps_neg work with multiple dependencies 2013-11-29 23:31:17 +01:00
features.py build: hide duplicate options from --help 2013-12-26 10:09:17 +01:00
inflectors.py
waf_customizations.py