[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: failure to build due to ignoring fwrite() result
From: |
Bruno Haible |
Subject: |
Re: failure to build due to ignoring fwrite() result |
Date: |
Tue, 31 Aug 2010 03:24:52 +0200 |
User-agent: |
KMail/1.9.9 |
Hi Paul,
> + @pindex gcc
> @pindex lint
> ! @pindex valgrind
> ! Don't make the program ugly to placate @code{gcc -Wall}, @code{lint},
> ! @code{valgrind}, or other software analysis tools. These tools can
> ! help find bugs, but they can also generate false alarms for constructs
> ! that they incorrectly consider to be suspicious. Although we want
> ! useful warnings and don't want useless ones, we also want code that is
> ! as readable as possible and is not cluttered with unnecessary casts or
> ! wrappers. For example, in C, please don't insert casts to @code{void}
> ! or replace @code{0} with @code{NULL} merely to pacify a lint checker.
This proposed change does not describe today's common practice:
- "gcc -Wall" is useful for everyday work. The majority of GNU maintainers
produces code that passes "gcc -Wall" checks, only a few (like the bash
maintainer) don't. Some GNU maintainers even enable many more warnings
(see gnulib/modules/manywarnings).
- Most people nowadays use NULL to denote the null pointer; when a tool
warns about 0 being implicitly converted to a pointer, this hint is
helpful because it prevents other people from being confused.
I'll try to come up with a wording that reflects current modern practice,
tomorrow.
Bruno