[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problem backporting libhmsbeagle

On 17.06.2017 14:08, James Cowgill wrote:
On 17/06/17 12:03, Gunter Königsmann wrote:
Even if these code lines would work they probably should be reformulated
by upstream so they are easier to read:

++i assigns I the value I+1 and returns the new i. And then i is
assigned another new value by the i= in the same line...

...a better way to express what I believe the line should mean would be:

i &= 3;

Perhaps the c compiler is as unsure which assignment should have the
precedence as I am.

(it is not a problem of precedence [it is unambiguous]; it is problem of *order of execution* [it is undefined])

Or "i = (i + 1) & 0x3" which I think looks better.

The original code invokes undefined behavior so is wrong anyway. I have
no idea why this only affects jessie-backports though.

Buggy code is present in the source from jessie (and current jessie-backports) too, but it looks like opencl code is only used/compiled from stretch/sid on. And why it was not detected on stretch? Because testsuite was not run:

=== cut https://buildd.debian.org/status/fetch.php?pkg=libhmsbeagle&arch=i386&ver=2.1.2%2B20160831-5&stamp=1478100755&raw=0 ===
make[1]: Entering directory '/«BUILDDIR»/libhmsbeagle-2.1.2+20160831'
No OpenCL platform available, skipping test
make[1]: Leaving directory '/«BUILDDIR»/libhmsbeagle-2.1.2+20160831'

Reply to: