On Tue, Oct 08, 2013 at 11:59:09AM +0200, Alexander Huemer wrote:
Dear Alexander,
Well, as I see it the test against 0xFF is not true
under any
circumstances, as long as the code is not intentionally compiled with
-funsigned-char. If there is an undesired behavior change because of
this code change, it's a bug. What's your opinion?
well, I agree that it is not nice and we can/should change it to a
plain null termination. What I doubt that it is currently a problem
or can you present a smoking gun?
int main(int argc, char **argv)
{
signed char a = 0xFF;
signed char b = 0xFF;
if (a == b)
printf("THE SAME\n");
return 0;
}
PS: some ABIs.. e.g. ARM ones.. char will be unsigned.