Re: Comparison of promoted ~unsigned
Re: Comparison of promoted ~unsigned
- Subject: Re: Comparison of promoted ~unsigned
- From: Jonny Taylor <email@hidden>
- Date: Tue, 6 Oct 2009 23:07:19 +0100
No, I think the OP is right; the second warning is wrong, assuming it does indeed warn on that line (I haven't checked). The cast to unsigned short means that the latter comparison was between two unsigned shorts, which shouldn't warn.
Thanks for the confirmation Alastair. The worry, of course, is that the compiler has ignored the cast for some reason and that that's why the warning is being generated.
Indeed, though the generated code at -O3 is in fact identical to your proposed rewrite in a simple case that I disassembled, so hopefully it is just the warning that is wrong. I will go with your suggested rewrite though, just to shut up the spurious warnings if nothing else (I only hit the problem about half a dozen times in my code).
Bug 7281365 raised.
Cheers Jonny |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden