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++ - Minor Bug
typedef union { uint32 all; struct { uint32 a:7, b:9, c:6, d:10; }; } ut; ut u; u.a=0; u.b=0; u.c=0; u.d=0; // initializing all 32 bits dosomething(u); /* The compiler will issue a warning that u is not initialized before its use. But it will issue the warning only if the optimizer is on. */ Jan 12 2005
"MarsRook" <MarsRook_member pathlink.com> wrote in message news:cs3app$1q0u$1 digitaldaemon.com...typedef union { uint32 all; struct { uint32 a:7, b:9, c:6, d:10; }; } ut; ut u; Jan 12 2005
Thanks for your info. But this time I did not intend to get assistance, I rather wanted to post info about the observed dmc behaviour. There are actually several ways to keep dmc quiet during compilation. It just does not make sense to me initializing the union first and then assigning values to the individual bitfields. ------------ In article <cs3baj$1qk4$1 digitaldaemon.com>, Jackson A. Marshall says..."MarsRook" <MarsRook_member pathlink.com> wrote in message news:cs3app$1q0u$1 digitaldaemon.com...typedef union { uint32 all; struct { uint32 a:7, b:9, c:6, d:10; }; } ut; ut u; Jan 13 2005
"MarsRook" <MarsRook_member pathlink.com> wrote in message news:cs5v4p$2hm6$1 digitaldaemon.com...In article <cs3baj$1qk4$1 digitaldaemon.com>, Jackson A. Marshall says..."MarsRook" <MarsRook_member pathlink.com> wrote in message news:cs3app$1q0u$1 digitaldaemon.com...typedef union { uint32 all; struct { uint32 a:7, b:9, c:6, d:10; }; } ut; ut u; Jan 13 2005
In article <cs641i$2nae$1 digitaldaemon.com>, Jackson A. Marshall says... Jan 13 2005
"MarsRook" <MarsRook_member pathlink.com> wrote in message news:cs7ldt$19ad$1 digitaldaemon.com...I'll still call this "minor bug" unless I find someone who can lecture me how to express this phenomenon otherwise. Feb 16 2005
|