[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] Re: leafnode-2.0.0.alpha20030621a released



Michael Mauch schrieb am 2003-06-21:

> Ah, great! My gcc-2.95.3 (glibc-2.1.3) was a bit unhappy with
> fetchnews.c, though:
> 
> fetchnews.c: In function `postarticles':
> fetchnews.c:1525: warning: declaration of `dup' shadows global declaration
> fetchnews.c:1533: parse error before `char'
> fetchnews.c:1534: `ngs' undeclared (first use in this function)
> fetchnews.c:1534: (Each undeclared identifier is reported only once
> fetchnews.c:1534: for each function it appears in.)
> fetchnews.c: In function `remove_watermark':
> fetchnews.c:1619: warning: cast discards qualifiers from pointer target type

Ouch, there was C99 syntax that older gcc versions don't handle. Here's
a patch, 20030621b due in a couple of minutes:

Index: fetchnews.c
===================================================================
RCS file: /var/CVS/leafnode-2/fetchnews.c,v
retrieving revision 1.116
diff -u -r1.116 fetchnews.c
--- fetchnews.c	21 Jun 2003 10:24:33 -0000	1.116
+++ fetchnews.c	21 Jun 2003 14:36:58 -0000
@@ -1522,15 +1522,15 @@
 				/* FIXME: don't fail here */
 			    }
 			} else {
-			    int dup = 0;
+			    int xdup = 0;
 			    ln_log(LNLOG_SINFO, LNLOG_CARTICLE,
 				   "Posting %s", *y);
 			    
-			    if (post_FILE(f, &line) || (dup = strncmp(line, "441 435 ", 8) == 0)) {
-				if (dup)
+			    if (post_FILE(f, &line) || (xdup = strncmp(line, "441 435 ", 8) == 0)) {
+				char *ngs = fgetheader(f, "Newsgroups:", 1);
+				if (xdup)
 				    ln_log(LNLOG_SINFO, LNLOG_CARTICLE,
 					    "Duplicate article %s, treating as success.", *y);
-				char *ngs = fgetheader(f, "Newsgroups:", 1);
 				if (ngs != NULL) {
 				    char *mod = checkstatus(ngs, 'm');
 				    char *app = fgetheader(f, "Approved:", 1);

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list