Hide Forgot
#include <sys/types.h> #include <stdio.h> #define FLAG 0x00000200 class FlagTest { public: int16_t mFlags; FlagTest (void) { mFlags = 0; } void SetFlag (u_int32_t flag, bool value) { if (value) mFlags |= flag; else mFlags &= ~flag; } bool GetFlag (u_int32_t flag) { return (mFlags & flag); } }; int main (void) { FlagTest test; printf ("initial state %d\n", test.GetFlag(FLAG)); test.SetFlag (FLAG, 1); printf ("set state %d\n", test.GetFlag(FLAG)); } [msw@pitr msw]$ gcc -O -o testcase testcase.cpp You have mail in /home/devel/msw/ [msw@pitr msw]$ ./testcase initial state 0 set state 0 [msw@pitr msw]$ gcc -o testcase testcase.cpp [msw@pitr msw]$ ./testcase initial state 0 set state 1
Created attachment 6943 [details] testcase for bug
Richard fixed this, the patch is in my patchset for 2.96-70.