Timeline for Shortest code to produce infinite output
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 19, 2020 at 4:54 | comment | added | Joseph Sible-Reinstate Monica | @greggo As of C99, that's not true. The standard now has a special case for main that requires falling off the end to be equivalent to return 0;. | |
| Feb 7, 2014 at 14:52 | comment | added | greggo | @marinus 'main' returns int; with no 'return' the return value is unspecified. So it is an opportunity to use a tail call; the return value from caller 'main' can be whatever the called function 'main' leaves in the register (which in this case, of course, is whatever 'main' leaves in the register, which is nothing since it never returns..) | |
| Jan 27, 2014 at 16:59 | comment | added | James Webster | @psgivens. In c a function without any parameters can take any amount of parameters. Only a signature of methodName(void) accepts exactly zero parameters. | |
| Jan 14, 2014 at 22:33 | comment | added | Phillip Scott Givens | Am I missing something? Shouldn't main take a parameter in order to take a parameter? | |
| Dec 30, 2013 at 13:39 | comment | added | marinus | @JohannesKuhn: that's not a tail call. If it'd been return main(puts("1")) then it'd been a tail call. | |
| Nov 28, 2013 at 8:38 | comment | added | Johannes Kuhn | Tailcall optimisation ftw. | |
| Nov 11, 2013 at 11:46 | comment | added | Ilya Gazman | I am not sure that there are stackoverflow exception in C, but something bad will happen when you run out of memory. | |
| Nov 10, 2013 at 17:13 | history | edited | Rozuur | CC BY-SA 3.0 | added 19 characters in body |
| Nov 10, 2013 at 14:05 | comment | added | ugoren | s/while/main/ | |
| Nov 9, 2013 at 17:10 | review | Low quality posts | |||
| Nov 10, 2013 at 0:48 | |||||
| Nov 9, 2013 at 16:54 | history | answered | Rozuur | CC BY-SA 3.0 |