Top all-time · #4230
Dev Blog for things that I find cool
Personal blog · jroweboy.github.ioprogrammingsystems
Dev Blog for things that I find cool is a personal blog at jroweboy.github.io about programming and systems. Since 2015, 18 different Hacker News readers have linked it 18 times, most often “Main is usually a function, so when is it not? (2015)”. The last post was in 2015, but the archive is still widely read.
Too few sampled comments (7) to say how often HN recommends it.?
Why HN links it
HN readers link a 2015 post asking when main is not a function in C, covering tricks such as defining main as an array and executing an array as code, plus C and assembly quirks.
Summarised by Claude from a sample of 7 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
A blog dedicated to documenting things that I find interesting and things that I'm working on
Most-linked posts?
- Main is usually a function, so when is it not? (2015)12 people · 12 mentions · first linked 2015-05-22
- Main is usually a function – when is it not?6 people · 6 mentions · first linked 2015-01-27
What Hacker News says?
I’m disappointed. I expected some obscure edgecase (like “Main is usually a function…” [1]) but instead that’s about scope handling, contract design and responsibility shift. “Hello world” method simply calls an API to a text interface. It uses simple call, to a simple interface that is expected to be ever present. I don’t find any bug there. It won’t work if such interface isn’t available, is blocked or doesn’t exi…
Comment linking /c/asm/2015/01/26/when-is-main-not-a-function.html
on “Bugs in Hello World”Submitted Main is usually a function – when is it not? as a story · 338 points
HN discussionYou may be thinking of https://jroweboy.github.io/c/asm/2015/01/26/when-is-main-not...
Comment linking /c/asm/2015/01/26/when-is-main-not-a-function.html
on “You can't copy code with memcpy”Submitted Main is usually a function, so when is it not? (2015) as a story · 224 points
HN discussionThe author says “I tried to define ‘main’ as an array of shorts with a modern compiler and it did not like that one bit”, but without saying which modern C compiler or what it didn’t like about it. This sort of trick should still be possible with modern compilers. GCC has the charming warning warning: ‘main’ is usually a function [-Wmain] if main is declared as something other than a function. Here’s someone who got…
Comment linking /c/asm/2015/01/26/when-is-main-not-a-function.html
on “Exploring mullender.c – A deep dive into the first IOCCC winner”Submitted Main is usually a function, so when is it not? (2015) as a story · 136 points
HN discussionMight have to make code const: http://jroweboy.github.io/c/asm/2015/01/26/when-is-main-not-...
Comment linking /c/asm/2015/01/26/when-is-main-not-a-function.html
on “Exploring mullender.c – A deep dive into the first IOCCC winner”Submitted Main is usually a function. So then when is it not? as a story · 3 points
HN discussionVery similar, here's main() as an array http://jroweboy.github.io/c/asm/2015/01/26/when-is-main-not-...
Comment linking /c/asm/2015/01/26/when-is-main-not-a-function.html
on “Executing an array as a function”Submitted Main is usually a function. So then when is it not? as a story · 2 points
HN discussionMakes me think of the "when is main not a function" article from 2015: http://jroweboy.github.io/c/asm/2015/01/26/when-is-main-not-...
Comment linking /c/asm/2015/01/26/when-is-main-not-a-function.html
on “Show HN: 'Hello, World ' in x86 assembly, but make it gibberish”Submitted Main is usually a function. So then when is it not? (2015) as a story · 2 points
HN discussionon similar lines, i find this http://jroweboy.github.io/c/asm/2015/01/26/when-is-main-not-... quite entertaining !
Comment linking /c/asm/2015/01/26/when-is-main-not-a-function.html
on “Quirks of C”Submitted Main is usually a function. So then when is it not? as a story · 2 points
HN discussionSubmitted Main is usually a function. So then when is it not? as a story · 2 points
HN discussionSubmitted Main is usually a function. So then when is it not? as a story · 2 points
HN discussionSubmitted Main is usually a function. So then when is it not? (2015) as a story · 1 points
HN discussionSubmitted Main is usually a function. So then when is it not? (2015) as a story · 1 points
HN discussion