Pelles C forum

Pelles C => Bug reports => Topic started by: JohnF on July 21, 2012, 11:36:21 AM

Title: unreachable code with 'maximize speed'
Post by: JohnF on July 21, 2012, 11:36:21 AM
The following code is fine with optimized speed if "BM" is a string but will not do as a literal.


#include <stdio.h>

int main(void)
{
short bfType = 0x4D42;

if ((bfType == *(short *)"BM"))
{
printf("OK\n"); // unreachable code with 'maximize speed'
}
else
{
printf("Not OK\n");
}

return 0;
}


John
Title: Re: unreachable code with 'maximize speed'
Post by: Pelle on September 01, 2012, 08:22:55 PM
Questionably code, at least. I will see what I can do...