<div dir="ltr">On Tue, Aug 13, 2013 at 2:03 PM, Gao, Yunzhong <span dir="ltr"><<a href="mailto:yunzhong_gao@playstation.sony.com" target="_blank">yunzhong_gao@playstation.sony.com</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Nick,<br>
Thanks for reviewing the patch.<br>
I will change the type conversion to "unsigned char" instead; that should make<br>
the result deterministic.<br>
I feel that this is probably still not an ideal solution because the host machine<br>
might have a different size for "char" type than the target machine, but in the<br>
llvm backend I did not find a way to extract the size of target "char" type. I<br>
would guess that machines with non-8-bit bytes are rare nowadays? Since<br>
the patch is only intended for a corner-case comparing a value with zero, it<br>
might suffice using a cast to "unsigned char" or even "(value & 255)".<br>
What do you think?<br>
<div class="HOEnZb"><div class="h5"><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank"></a></div></div></blockquote><div><br></div><div>Assuming char is 8 bits is probably good enough.   You could also extract the relevant type out of the function signature; the first argument to strchr is a char*.</div>
</div><br></div><div class="gmail_extra">-Eli</div></div>