|
From: Philippe W. <phi...@sk...> - 2015-04-01 18:30:33
|
On Wed, 2015-04-01 at 13:53 +0200, Florian Krohm wrote:
> clang 3.6.0 says:
>
> m_transtab.c:1548:42: warning: variable 'i' is uninitialized when used
> here [-Wuninitialized]
> for (EClassNo e = 0; e < ECLASS_N; i++) {
>
> and it is right.. I suppose that was meant to read "e++" ?
Thanks for the bug report.
This causes an infinite loop when a sector is recycled.
Fixed in r15058.
I will update a regtest so that sector recycling is tested by
at least one test :(.
> clang's recommendation for a fix is quite funny;
>
> m_transtab.c:1422:10: note: initialize the variable 'i' to silence this
> warning
>
> That recommendation is a manager's approach to fix compiler warnings :)
Effectively, silence a warning is not the same as fixing a warning :).
But let's not criticise clang : warning well found.
(gcc usually finds this kind of things also IIRC, but not here ?).
>
> Come to think of it .. a really good warning here would have been: loop
> does not iterate.
I guess this implies to check the loop body to see if the loop variable
is modified or not.
Philippe
|