|
Enjoyable read for sure, but i think the question whether ot not this constitutes a bug or not is open for interpretation. IMHO, it doesn't. hello.c is written in a way that makes it very clear that the program doesn't care about error conditions in any way shape or form; the return value of printf is ignored, the output isn't flushed, the return of flushing isn't checked, noone looks at errno; ...so anything happening that could go wrong will go unreported, unless its something the OS can see (segfault, permission, etc.) If I expect a program to do something (eg. handle IO errors) that its code says very clearly that it doesn't, that's not the programs fault. |
Is there no such thing as a bug then? The program does what the code says so every "misbehavior" and crash is expected behavior.