6.3.2.3p7 considers it relevant.
6.3.2.3p7 considers it relevant.
I recently pointed out that overflow in a signed integer is defined by the standard as "undefined behaviour".
On reflection I'm wondering if there is any compiler that does not handle the overflow in the manner that would be logically/properly expected.
And thus a pedantic following of the standard in this case might be to deprive oneself of a useful technique?
O_oOn reflection I'm wondering if there is any compiler that does not handle the overflow in the manner that would be logically/properly expected.
Virtually all compilers handle the overflow in a manner that would be logically unexpected.
I can already see some people yelling "What!?", but before you post allow me to explain.
Virtually all compilers have optimizations related to signed integer overflow; depending on compiler flags (command line arguments), pagrams, and similar compilers do very different things with signed integer overflow.
"CLANG", "Intel", "GCC", and "Microsoft Visual C++" all have modes which will result in broken code if you've implemented almost any form of branching related to signed integer overflow.
Soma
“Salem Was Wrong!” -- Pedant Necromancer
“Four isn't random!” -- Gibbering Mouther
Saved from the dark side.
More like Z. Y. X. W. V. U. T. S. But sure!
So this topic makes me want to assert, arrays are flat, right? Like, they're all just 1D arrays with row/column-major indexing, right? C defaults to row, Fortan defaults to column, etc.
With regard to the object representation, int[5][2] and int[5 * 2] are identical. However, the type system considers an int[5][2] incompatible with an int[5 * 2], so in that regard they are unique from one another. It is my opinion that staying within the strict, predictable type system is invariably the smarter choice when faced with the option.
Back to the important stuff.
While on the subject of pronounciation - if I split my username into its 2 syllables:
Gem - the g is pronounced like the hard g in get.
Era - is pronounced like era but the e is actually a soft a as in "hair".
The name is, of course, derived from the Ancient Atlantean for "exceptionally wonderful person".
Ho -- Hoe
Dor -- Door
HODOR
Alternatively you may pronounce my name like HOLD-OR or HOLD-ER and I will still respond.
Last edited by Hodor; 03-17-2014 at 06:46 PM.
O_oI will still respond.
Of course, you will respond only with "HODOR, hodor, HoDoR!" in any event.
Soma
“Salem Was Wrong!” -- Pedant Necromancer
“Four isn't random!” -- Gibbering Mouther