Check the return value of some functions

Alexandre Julliard julliard at winehq.org
Fri Dec 9 04:40:15 CST 2005


Vincent Béron <vberon at mecano.gme.usherb.ca> writes:

> diff -u -r1.11 debug.c
> --- libs/wine/debug.c	18 Oct 2005 10:49:20 -0000	1.11
> +++ libs/wine/debug.c	8 Dec 2005 17:37:21 -0000
> @@ -172,7 +172,7 @@
>          "Example: WINEDEBUG=3D+all,warn-heap\n"
>          "    turns on all messages except warning heap messages\n"
>          "Available message classes: err, warn, fixme, trace\n";
> -    write( 2, usage, sizeof(usage) - 1 );
> +    fprintf( stderr, usage );

That's really silly. There's no reason that not checking the result of
write would be a bug, but making it a printf would suddenly make it
harmless. I think these warnings are really misguided, you can't just
decide that some functions need to be always checked and others not,
it depends on what the code is doing.

It's OK to turn on the warnings to see if there are places where they
turn up a real problem, but please don't "fix" places that are not
bugs.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list