On Tue, Nov 28, 2017 at 12:56 PM, Warner Losh <imp@bsdimp.com> wrote:Ah, the tyranny of static analysis tools... _exit(0) should be marked such that the tools know it does not return. This means the /*NOTREACHED*/ isn't needed. And since there's no real exit path out of main, the return (0) is equally bogus (because main can't return). Yet lint and other tools have ushered in this insanity.Hmm; in what way can main() not return? Surely this is true if `_exit(0)` is called as this calls the exit system call, which cannot -- by definition -- return. But main() itself can return to whatever calls it (usually `start`, I'd imagine). For that matter, I'm not aware of any prohibition against calling `main()` recursively.
This is much smaller than the binary for the assembler program I posted for macOS earlier in this thread: the result there was much larger (but due to the requirement to have a non-empty data segment in the executable; this ends up being page-aligned and filled with zeros).Contrast that with FreeBSD's /usr/bin/true:-r-xr-xr-x 1 root wheel 4624 Nov 20 11:56 /usr/bin/truetext data bss dec hex filename1540 481 8 2029 0x7ed /usr/bin/truewhich is little more than return(0), but also has a fair amount of copyright and SCCS data.Is the copyright data actually present in the object file? I see some RCS $Id$ strings (in the guise of $FreeBSD:$ stuff) but no copyright strings in /usr/bin/true on my system.