Timeline for Undefined Behavior Killed My Cat
Current License: CC BY-SA 3.0
20 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 17, 2020 at 9:04 | history | edited | Community Bot |
Commonmark migration
|
|
| Mar 21, 2014 at 4:10 | comment | added | Digital Trauma | @AnonymousPi Ja, mit zwei punkte. | |
| Mar 21, 2014 at 2:11 | comment | added | Anonymous Pi | It's spelled Shrödinger. But +1 for reference to quantum physics! | |
| Mar 9, 2014 at 11:19 | comment | added | Voo | @hvd good point. | |
| Mar 9, 2014 at 8:50 | comment | added | hvd |
@Voo INT_MIN / -1 is not always undefined behaviour, because INT_MIN is allowed to be equal to -INT_MAX, in which case the result of the division is representable.
|
|
| Mar 8, 2014 at 14:28 | comment | added | Doorknob | @devnull I'll do it for you ;) | |
| Mar 8, 2014 at 5:56 | comment | added | devnull | How can I upvote again given that the update mentions the probablity of killing the cat (42%)? | |
| Mar 6, 2014 at 22:04 | comment | added | Digital Trauma | @nneonneo Yes, I got that behavior too on OSX. Sorry, I don't have an answer as to why. | |
| Mar 6, 2014 at 22:02 | comment | added | Digital Trauma | @ugoren I edited, but I'm not sure if this is what you're looking for | |
| Mar 6, 2014 at 21:24 | history | edited | Digital Trauma | CC BY-SA 3.0 |
edited body
|
| Mar 6, 2014 at 20:55 | comment | added | nneonneo |
This hangs my bash on OS X (requires Ctrl+C to kill); why is that? (Yes, undefined behaviour yadda yadda, but you'd expect this to at least just quit somehow...)
|
|
| Mar 6, 2014 at 20:23 | history | edited | Digital Trauma | CC BY-SA 3.0 |
edited body
|
| Mar 6, 2014 at 19:54 | comment | added | Voo |
INT_MIN / -1 is always undefined behavior in C/C++, what wasn't clear was whether INT_MIN % -1 (modulo not division! 2^32 is not representable in 2 complement 32bit numbers, but 0 certainly is) was undefined behavior or not. According to your link they clarified that in C11 so good riddance for that.
|
|
| Mar 6, 2014 at 19:41 | comment | added | ugoren | Can you add the scenario, step by step, that kills the cat, with the probability analysis (as in the example)? As it is, this isn't a valid answer. | |
| Mar 6, 2014 at 4:11 | comment | added | Cristian Ciupitu | bugzilla.redhat.com/show_bug.cgi?id=579622 | |
| Mar 5, 2014 at 17:28 | comment | added | Digital Trauma |
@mardavi INT_MAX = 2^63 - 1. If we add 1 to INT_MAX, the 64bit number space wraps around and we get INT_MIN. In other words in signed 64bit integer arithmetic, 2^63 == -2^63. I could have used -2**63, but preferred the terseness without the -, since the modular arithmetic is the same in this case.
|
|
| Mar 5, 2014 at 9:18 | comment | added | V-X |
@klingt.net: It is called "Here Strings" - it is much more googlable... it is shortcut for echo $((-2**63/-1)) | cat
|
|
| Mar 5, 2014 at 8:34 | comment | added | klingt.net |
I know the use of < and <<, but what is the purpose of <<<? (used google but couldn't find anything)
|
|
| Mar 5, 2014 at 8:03 | comment | added | mardavi |
shouldn't it be cat <<< $((-2**63/-1))? Didn't you lose the - sign? Even if the behavior is the same, the minimum integer should be -
|
|
| Mar 4, 2014 at 19:25 | history | answered | Digital Trauma | CC BY-SA 3.0 |