Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2001 15:56:54 +0300
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        Alexey Zelkin <phantom@FreeBSD.ORG>
Cc:        cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/lib/libc/stdlib strfmon.c
Message-ID:  <20010906155654.I18362@sunbay.com>
In-Reply-To: <200109060926.f869QS033887@freefall.freebsd.org>; from phantom@FreeBSD.ORG on Thu, Sep 06, 2001 at 02:26:28AM -0700
References:  <200109060926.f869QS033887@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 06, 2001 at 02:26:28AM -0700, Alexey Zelkin wrote:
> phantom     2001/09/06 02:26:28 PDT
> 
>   Modified files:
>     lib/libc/stdlib      strfmon.c 
>   Log:
>   correctly wrap macros with { }
>   
>   Revision  Changes    Path
>   1.2       +4 -3      src/lib/libc/stdlib/strfmon.c
> 
Nope, this is incorrect.  You didn't read the whole thread.
The correct fix it is to wrap macros in ``{ } while(0)'':

#define PRINT(CH) do {						\
	if (dst >= s + maxsize)					\
		goto e2big_error;				\
	*dst++ = CH;						\
} while(0)

See style(9) for more details.


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010906155654.I18362>