summaryrefslogtreecommitdiffstats
path: root/usr.bin/nl/nl.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2006-12-22 05:54:19 +0000
committerimp <imp@FreeBSD.org>2006-12-22 05:54:19 +0000
commitc8daf471f404e6b8cb9efa830856785624584dfb (patch)
tree854c3003905a1ec5f028884087c50401b69c1cef /usr.bin/nl/nl.c
parent6e71b264de152512d7d44b1d1ddc4639a85f14c9 (diff)
downloadFreeBSD-src-c8daf471f404e6b8cb9efa830856785624584dfb.zip
FreeBSD-src-c8daf471f404e6b8cb9efa830856785624584dfb.tar.gz
Avoid 'bogus' uninitialized warning by initializing rather than
playing cute games. It is much simpler, clearer and easier to follow and understand. Besides, gcc4 likes it better.
Diffstat (limited to 'usr.bin/nl/nl.c')
-rw-r--r--usr.bin/nl/nl.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/usr.bin/nl/nl.c b/usr.bin/nl/nl.c
index f557185..afc3c860 100644
--- a/usr.bin/nl/nl.c
+++ b/usr.bin/nl/nl.c
@@ -296,14 +296,11 @@ filter()
int section; /* logical page section */
unsigned int adjblank; /* adjacent blank lines */
int consumed; /* intbuffer measurement */
- int donumber, idx;
+ int donumber = 0, idx;
adjblank = 0;
line = startnum;
section = BODY;
-#ifdef __GNUC__
- (void)&donumber; /* avoid bogus `uninitialized' warning */
-#endif
while (fgets(buffer, (int)buffersize, stdin) != NULL) {
for (idx = FOOTER; idx <= NP_LAST; idx++) {
OpenPOWER on IntegriCloud