Strange effects DDE C long long
Thomas Milius (7848) 116 posts |
I am facing strange effects (in my opinion) with a sequence written in C compiled by Norcroft C: unsigned long long temp_time; … ??? I would have expected 59b519ae10 for temp_time. Sometimes temp_time is correct. I assume that this What I am doing logically wrong? |
Stuart Swales (8827) 1357 posts |
I’ve been caught by that one before! Stepwise promotion is your friend: temp_time |= (unsigned long long) (unsigned int) regs.r[ 3 ]; |
Thomas Milius (7848) 116 posts |
Thanks for the hint! Of course as an alternative I can AND 0×00000000FFFFFFFF. But I wasn’t aware of that behaviour :-(. Easy to forget … |