Click here to Skip to main content
15,892,839 members

Comments by Shvetsov Evgeniy (Top 21 by date)

Shvetsov Evgeniy 17-Jun-16 10:06am View    
"ArrayItem[0] will be the low order part of the first 64-bit value, ArrayItem[1] will be the high order part" - on little-endian machines, i guess. The problem is, as i now know it, reading values using uint32_t* pointer, converted from original uint64_t* pointer - is undefined behaivour, due to the CPP standart. So it can be just garbage or this code can evenly be optimized out by the compiler. I hope it is NOT, as i'm using such a code already, but can't be sure, espically for other platforms. I really love C++ but some thimes i just hate it. And i blame myself for stupidity too.
Shvetsov Evgeniy 16-Jun-16 8:21am View    
Thanks for your reply! Yes, to handle the resulted values correctly is the problem.
Shvetsov Evgeniy 16-Jun-16 8:20am View    
Ok, looks like i didn't formed the question correctly (precisely enough), living too much room for condsierations. But this is my own fault, while your answer is detailed, interesting and usefull, i would accept it. Thank you.
Shvetsov Evgeniy 10-Jun-16 19:26pm View    
Well, as we say in Russia: "the old mule ploughs a straight urrow" :) ANY programming language which continues to evolve is affected by this problem. The Java language, i think, is the most famous example here. The problem is you can NOT foresee all, so the problem is strictly human based AND so it is insoluble, as the mankind, in opposite to the technology, is NOT evolving (OR at least NOT so fast).
Shvetsov Evgeniy 10-Jun-16 17:06pm View    
Thanks for your reply! "There is no reason to remove volatility using const_cast" - if there were NO reason, i guess C++ standardization committee would NOT allow to do that. "If stars are lit it means - there is someone who needs it".