Timeline for Execute prints backwards
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 5, 2016 at 17:47 | comment | added | G. Sliepen | Use puts("Line x") instead of printf("Line x\n") to save 16 bytes (assuming this is counted as an equivalent to "print"). | |
| Feb 18, 2014 at 16:08 | history | edited | Nick | CC BY-SA 3.0 | deleted 32 characters in body |
| Feb 15, 2014 at 15:07 | comment | added | A T | FYI: With gcc and clang you can compile this successfully with: -Wno-implicit-function-declaration argument. | |
| Feb 14, 2014 at 23:12 | comment | added | fluffy | @WillihamTotland well then I know of some code that I really need to fix... thanks | |
| Feb 14, 2014 at 15:08 | comment | added | Williham Totland | @fluffy: Alas, it is the other way around: C does not treat arglist commas as sequence points, unlike other commas. | |
| Feb 14, 2014 at 6:09 | comment | added | fluffy | I thought C treated arglist commas as a sequence point. | |
| Feb 13, 2014 at 21:21 | comment | added | Nick | As @GuntramBlohm said, the basic idea is that C function parameters are often (but not always) pushed onto the stack in a right-to-left order. Since these are function calls, the functions are probably (but not necessarily) called from right-to-left as well. All this is not defined by the C standard though, so while it happens to yield the right result in GCC 4 it's totally up to the compiler and calling convention what actually happens. | |
| Feb 12, 2014 at 21:53 | comment | added | Guntram Blohm | @svick: to support varargs, most C compilers put function arguments on the stack in reverse order (so the top item on the stack is always the 1st argument), which means they're likely to evaluate arguments in the same way. Of course, this assumes arguments are passed on the stack which becomes less and less the case with newer compilers. | |
| Feb 12, 2014 at 18:39 | comment | added | svick | I have absolutely no idea how come this actually works, +1. | |
| Feb 12, 2014 at 18:04 | history | answered | Nick | CC BY-SA 3.0 |