From 44f7c0f58b42276614a1bd9359cf4a4850958639 Mon Sep 17 00:00:00 2001 From: Kenneth G Raeburn Date: Thu, 28 Mar 1991 22:34:46 +0000 Subject: Redefine macro BAD to reduce lint warnings. --- lib/ZParseNot.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/ZParseNot.c') diff --git a/lib/ZParseNot.c b/lib/ZParseNot.c index 1aa4d3c..44ae68c 100644 --- a/lib/ZParseNot.c +++ b/lib/ZParseNot.c @@ -84,9 +84,17 @@ Code_t ZParseNotice(buffer, len, notice) u_short us; ZChecksum_t sum; } temp; + #ifdef __LINE__ int lineno; -#define BAD do{lineno=__LINE__;goto badpkt;}while(0) + /* Note: This definition of BAD eliminates lint and compiler + * complains about the "while (0)", but require that the macro not + * be used as the "then" part of an "if" statement that also has + * an "else" clause. + */ +#define BAD {lineno=__LINE__;goto badpkt;} + /* This one gets lint/compiler complaints. */ +/*#define BAD do{lineno=__LINE__;goto badpkt;}while(0)*/ #else #define BAD goto badpkt #endif @@ -121,7 +129,7 @@ Code_t ZParseNotice(buffer, len, notice) numfields -= 2; /* numfields, version, and checksum */ if (numfields < 0) { #ifdef __LINE__ - lineno = __LINE__ - 2; + lineno = __LINE__; badpkt: Z_debug ("ZParseNotice: bad packet from %s/%d (line %d)", inet_ntoa (notice->z_uid.zuid_addr.s_addr), -- cgit v1.2.3