On Tue, Aug 13, 2013, at 09:21 AM, andy pugh wrote: > On 13 August 2013 14:07, Michael Büsch <[email protected]> wrote: > > > I think you first have to cast to signed 32-bit and then to signed 64-bit. > > A far as I can see the fix is to cast the delta to signed-32 > explicitly rather than to "signed long" > > The point of the original email was not to pursue the particular bug > that I have but to address the issue that there being many more casts > to "long" that also might not do the expected thing in a 64-bit system > (where "long" is 64 bits rather than the 32-bits that they probably > were when the code was written.) >
Yeah. Deja vu all over again - same situation as when we (not emc, but the whole programming world) transitioned from 16 to 32 bits. I think the moral of the story is that types like int and long that don't explicitly state their size should be avoided like the plague for any work that involves hardware. And explicitly sized types such as s32, u16, s64, etc, should have been built into the language from the start, and treated on an equal footing with int, long, char, and the rest. Too many people (myself included) learned to use whichever standard type worked, rather than using explicitly sized types. That was partly because the latter weren't part of the language and were done differently on every platform. Or even in kernal vs. user space on the same platform. I'm not sure about now, but in the early EMC2 days the sized types were defined differently in kernel and user libraries. I think RTAPI typedefs a common set of explicitly sized types, and maps them to whatever the platform expects. -- John Kasunich [email protected] ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
