It does compile on Debian Sarge now without complaints.
@Kry
My experiment was of course not intended for production. I could see that this part of code was work in progress and didn't have the time to really grasp the surrounding context. I just wanted to find out what the problem was, because I couldn't see any. Call it professional curiosity

But why do you think my ugly fix would work slower? IMHO, the only difference to your code is that the conversion normally done implicitly by the compiler was done explicitly. And the question of the variable assignment inside the loop being a slow down depends on the optimizer. With a standard optimizer the resulting code could very well be the same.
I often have to work around compiler bugs or similar problems, because I have inherited projects that are old enough (>>20 years), that the compilers used at that time were still quite buggy. And no one pays for renewing, so all have to live with the work hours that go into programming around such annoying problems (Sometimes the code doesn't work anymore if I remove a comment line

).