From owner-cvs-all Thu Oct 18 8:20:23 2001 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 6D68637B40A; Thu, 18 Oct 2001 08:19:55 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id BAA25124; Fri, 19 Oct 2001 01:19:52 +1000 Date: Fri, 19 Oct 2001 01:19:01 +1000 (EST) From: Bruce Evans X-X-Sender: To: Dag-Erling Smorgrav Cc: , Subject: Re: cvs commit: src/lib/libfetch Makefile common.c common.h ftp.c http.c In-Reply-To: <200110180829.f9I8TQj26821@freefall.freebsd.org> Message-ID: <20011019010459.L25252-100000@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 18 Oct 2001, Dag-Erling Smorgrav wrote: > des 2001/10/18 01:29:26 PDT > > Modified files: > lib/libfetch Makefile common.c common.h ftp.c http.c > Log: > Tons of type, style and warning fixes that have been rotting in my tree for > ages - some of which wouldn't be necessary if gcc wasn't broken or TPTB were > willing to do something (-fno-builtin) about it. > > Revision Changes Path > 1.23 +31 -9 src/lib/libfetch/Makefile > 1.21 +8 -5 src/lib/libfetch/common.c > 1.16 +11 -11 src/lib/libfetch/common.h > 1.71 +29 -29 src/lib/libfetch/ftp.c > 1.45 +24 -18 src/lib/libfetch/http.c This adds lots of digusting gcc-specific-hacks which have been rejected in other source files. E.g.: > Index: common.c > =================================================================== > RCS file: /home/ncvs/src/lib/libfetch/common.c,v > retrieving revision 1.20 > retrieving revision 1.21 > diff -c -1 -r1.20 -r1.21 > *** common.c 30 Sep 2001 21:36:08 -0000 1.20 > --- common.c 18 Oct 2001 08:29:26 -0000 1.21 > *************** > *** 29,31 **** > #include > ! __FBSDID("$FreeBSD: src/lib/libfetch/common.c,v 1.20 2001/09/30 21:36:08 dillon Exp $"); > > --- 29,31 ---- > #include > ! __FBSDID("$FreeBSD: src/lib/libfetch/common.c,v 1.21 2001/10/18 08:29:26 des Exp $"); > > *************** > *** 342,350 **** > /* XXX should enforce timeout */ > ! iov[0].iov_base = (char *)str; > iov[0].iov_len = len; > ! iov[1].iov_base = (char *)ENDL; > iov[1].iov_len = sizeof ENDL; > wlen = writev(fd, iov, 2); > DEBUG(fprintf(stderr, "\033[1m>>> %s\n\033[m", str)); > ! return (wlen != len); > } > --- 342,353 ---- > /* XXX should enforce timeout */ > ! (const char *)iov[0].iov_base = str; /* XXX */ Casts are not lvalues in C. > iov[0].iov_len = len; > ! (const char *)iov[1].iov_base = ENDL; /* XXX */ Another. > iov[1].iov_len = sizeof ENDL; > + len += sizeof ENDL; > wlen = writev(fd, iov, 2); > + if (wlen < 0 || (size_t)wlen != len) > + return -1; > DEBUG(fprintf(stderr, "\033[1m>>> %s\n\033[m", str)); > ! return 0; > } C compilers don't get far with this. E.g.: $ make CC='tcc -Ysystem' Warning: Using /usr/src/lib/libfetch/obj as object directory instead of canonical /usr/obj/usr/src/lib/libfetch tcc -Ysystem -O -pipe -I. -DINET6 -DNDEBUG -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Werror -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -c /usr/src/lib/libfetch/fetch.c -o fetch.o tcc: Warning: Unknown option, -pipe. tcc: Warning: Unknown option, -W. tcc: Warning: Unknown option, -Wall. tcc: Warning: Unknown option, -Wstrict-prototypes. tcc: Warning: Unknown option, -Wmissing-prototypes. tcc: Warning: Unknown option, -Wpointer-arith. tcc: Warning: Unknown option, -Wno-uninitialized. tcc: Warning: Unknown option, -Werror. tcc: Warning: Unknown option, -Wreturn-type. tcc: Warning: Unknown option, -Wcast-qual. tcc: Warning: Unknown option, -Wwrite-strings. tcc: Warning: Unknown option, -Wswitch. tcc: Warning: Unknown option, -Wshadow. tcc -Ysystem -O -pipe -I. -DINET6 -DNDEBUG -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Werror -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -c /usr/src/lib/libfetch/common.c -o common.o tcc: Warning: Unknown option, -pipe. tcc: Warning: Unknown option, -W. tcc: Warning: Unknown option, -Wall. tcc: Warning: Unknown option, -Wstrict-prototypes. tcc: Warning: Unknown option, -Wmissing-prototypes. tcc: Warning: Unknown option, -Wpointer-arith. tcc: Warning: Unknown option, -Wno-uninitialized. tcc: Warning: Unknown option, -Werror. tcc: Warning: Unknown option, -Wreturn-type. tcc: Warning: Unknown option, -Wcast-qual. tcc: Warning: Unknown option, -Wwrite-strings. tcc: Warning: Unknown option, -Wswitch. tcc: Warning: Unknown option, -Wshadow. "/usr/src/lib/libfetch/common.c", line 343: Error: [Syntax]: Parse error before '='. [Syntax]: Can't recover from this error. *** Error code 1 Stop in /usr/src/lib/libfetch. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message