Message165824
The problem is with the 'BIT_MASK' macro, which is currently defined as the following for Windows:
#define BIT_MASK(size) ((1 << NUM_BITS(size))-1)
The C standard says that any attempt to shift left by exactly the bit width is undefined behavior. For the given test case 'NUM_BITS(size) == 32' and the '1' constant is of type 'int'. Thus the behavior is undefined.
For x86 Windows with the MSVC++ compiler this ends up as 'SAL edx, CL' and the Intel manuals say that the shift count is masked by 0x1F. Thus the bit mask ends up as '(1 << 0) - 1 == 0'. Plug the zero mask into the 'SET' macro and you will see why the reported behavior is being observed.
I tested Hirokazu's last patch on Windows 7 64-bit and OS X 10.7; I saw no regression. I will apply the patch shortly. |
|
Date |
User |
Action |
Args |
2012-07-19 04:36:37 | meador.inge | set | recipients:
+ meador.inge, theller, ocean-city, ned.deily, stutzbach, r.david.murray, higstar, vladris, hct |
2012-07-19 04:36:36 | meador.inge | set | messageid: <1342672596.67.0.134985248866.issue6493@psf.upfronthosting.co.za> |
2012-07-19 04:36:35 | meador.inge | link | issue6493 messages |
2012-07-19 04:36:34 | meador.inge | create | |
|