|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++.beta - [bug] dmc.8.48.3 bit fields for 64-bit integer
Code below produces incorrect output (seems that code generator makes
invalid code, since nothing is changed when compiling with -o-all):
a.pos = A;
b.pos = 1234567890A;
But clearly, these values should be identical; Due to this bug I can't
use bitfields for int64 in structure.
Nic Tiger.
dmc int64_bug.cpp
----------------------
#include <stdio.h>
#include <stdint.h>
struct A {
uint64_t pos: 36;
};
struct B {
uint64_t pos;
};
int main() {
A a;
B b;
a.pos = 0x1234567890A;
b.pos = 0x1234567890A;
printf ( "a.pos=%llX\n", a.pos );
printf ( "b.pos=%llX\n", b.pos );
return 0;
}
Apr 14 2006
Nic Tiger wrote:Code below produces incorrect output (seems that code generator makes invalid code, since nothing is changed when compiling with -o-all): a.pos = A; b.pos = 1234567890A; But clearly, these values should be identical; Due to this bug I can't use bitfields for int64 in structure. Apr 14 2006
|