Nick Clifton wrote: > > Shifting into and out of the sign bit of an integer is undefined, > > and this loop unconditionally does both. The below patch should fix > > it. > > Patch approved and applied. Thanks for reporting this.
Thanks! This idiom also appears in newlib and in various versions of GDB and associated codebases. I'm not sure how this maps to actual development repos. All forms I found are one of the following source text snippets: > (m = 1; m != 0; m <<= 1) > (i = 1; i; i <<= 1) If you grep for that, you may find more. Of course, it's only a bug if the variable is signed. If you're getting annoying false positives, I'm happy to help with Coccinelle. That's what I used to find these. Best, Michael _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils