From owner-cvs-all Thu Sep 6 0:18:20 2001 Delivered-To: cvs-all@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 7B28A37B407; Thu, 6 Sep 2001 00:18:07 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f867Hq981053; Thu, 6 Sep 2001 10:17:52 +0300 (EEST) (envelope-from ru) Date: Thu, 6 Sep 2001 10:17:52 +0300 From: Ruslan Ermilov To: Mark Peek Cc: Alexey Zelkin , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/stdlib strfmon.c Makefile.inc Message-ID: <20010906101752.D74323@sunbay.com> References: <200109051850.f85Io3o99434@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mark@whistle.com on Wed, Sep 05, 2001 at 07:07:09PM -0700 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 Wed, Sep 05, 2001 at 07:07:09PM -0700, Mark Peek wrote: > At 11:50 AM -0700 9/5/01, Alexey Zelkin wrote: > >phantom 2001/09/05 11:50:02 PDT > > > > Modified files: > > lib/libc/stdlib Makefile.inc > > Added files: > > lib/libc/stdlib strfmon.c > > Log: > > Add strfmon(3) implementation. It still contains few XXX's because I lost > > my last version of this work due to HDD crash, but this version cleanly > > passed all POSIX and SuSv2 tests. I am working on testing scripts which > > should test this implementation against all locales and surely more fixes > > will come soon. > > > > Reviewed by: ache, silence at -audit & -developers > > > > Revision Changes Path > > 1.29 +4 -4 src/lib/libc/stdlib/Makefile.inc > > > This broke my -current buildworld: > > cc -nostdinc -O -pipe -DLIBC_RCS -DSYSLIBC_RCS -I/usr/src/lib/libc/include -I/usr/src/lib/libc/../../include -DLIBC_MAJOR=5 -D__DBINTERFACE_PRIVATE -DINET6 -I/usr/obj/usr/src/lib/libc -DPOSIX_MISTAKE -I/usr/src/lib/libc/../libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -DYP -DHESIOD -I/usr/obj/usr/src/i386/usr/include -c /usr/src/lib/libc/../libc/stdlib/strfmon.c -o strfmon.o > /usr/src/lib/libc/../libc/stdlib/strfmon.c: In function `strfmon': > /usr/src/lib/libc/../libc/stdlib/strfmon.c:302: syntax error before `else' > /usr/src/lib/libc/../libc/stdlib/strfmon.c:233: label `end_error' used but not defined > /usr/src/lib/libc/../libc/stdlib/strfmon.c:162: label `format_error' used but not defined > /usr/src/lib/libc/../libc/stdlib/strfmon.c:144: label `e2big_error' used but not defined > > Below is a patch that matches the code put up for review at > http://phantom.cris.net/~phantom/strfmon04.tgz > Nope, the correct fix would be to do it the style(9) way: Index: strfmon.c =================================================================== RCS file: /home/ncvs/src/lib/libc/stdlib/strfmon.c,v retrieving revision 1.1 diff -u -p -r1.1 strfmon.c --- strfmon.c 2001/09/05 18:50:02 1.1 +++ strfmon.c 2001/09/06 07:18:36 @@ -54,11 +54,11 @@ static char rcsid[] = "$FreeBSD: src/lib #define IS_NEGATIVE 0x80 /* is argument value negative ? */ /* internal macros */ -#define PRINT(CH) { \ +#define PRINT(CH) do { \ if (dst >= s + maxsize) \ goto e2big_error; \ *dst++ = CH; \ -} +} while(0) #define PRINTS(STR) { \ char *tmps = STR; \ Oh, and this file is terribly broken in the style(9) sense. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message