Re: Shut Up With The Open Source Politics, OK?

"John" <[email protected]>
Newsgroups gmane.linux.usability.annoyances
Message-ID <3F886D29.31919.10DED4A@localhost>
On 11 Oct 2003 at 10:52, [email protected] wrote:
> 
> You mean:
> 
> #include <stdio.h>
> main()
> {
>   printf( "Hello, world" );
> }
> 
> ?
> 
> There's a bug there, in that it doesn't check the return code from printf().
> 

Not a bug. You are allowed to ignore the return code of a 
function if you don't intend to do anything with it. If you want 
to trap an error, and do something about it then it's another 
matter. Obviously here Brian & Dennis decided, wisely, that if 
it wrote to stdout all was fine, and if it didn't you'd find out 
soon enough without extra complications in the code. Checking 
the return value is not mandatory, and sometimes completely 
useless.

However it might be wise to declare the type of main() (my compiler
grumbles if you don't), and if "int", then have "exit 0" as the last
statement :^)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.