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