0

I'm building a library against the 5.0 sdk GCC and running the code on a 4.2.x device.

I'm not using 5.0 objective-c specific calls in this layer and the project is compatible to ship on 4.0+.

I'm seeing some behavior in my library that is really odd with my if blocks.

typically this should work

BYTE    byteVal : 1;

byteVal = FALSE;

if (byteVal)
    // ALWAYS RUNS

The problem being that the code in the if block is always executing.

This is causing me problems with zlib gzip functionality. Is the 4.2.x OS using some offset or different register alignment that isn't standard with building with the newer GCC?

I'm at a loss as to what is going on here and why this fails always on 4.2.x devices.

Any thoughts?

cynistersix
  • 1,215
  • 1
  • 16
  • 30

1 Answers1

0

use

if (byteVal == 1)

There is some problem with using single bit wide member variables that the if (byteVal) is always true even when it is not.

cynistersix
  • 1,215
  • 1
  • 16
  • 30