From owner-freebsd-hackers Wed Nov 6 8:54:20 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4D11A37B434 for ; Wed, 6 Nov 2002 08:54:19 -0800 (PST) Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCFFF43E3B for ; Wed, 6 Nov 2002 08:54:18 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 2623 invoked from network); 6 Nov 2002 16:54:21 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail13.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 6 Nov 2002 16:54:21 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id gA6GsFn5052570; Wed, 6 Nov 2002 11:54:16 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20021106164653.GA95733@stack.nl> Date: Wed, 06 Nov 2002 11:54:17 -0500 (EST) From: John Baldwin To: Marc Olzheim Subject: RE: /usr/src/ed/bin/re.c:99 Cc: hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 06-Nov-2002 Marc Olzheim wrote: > .. > if ((nd = parse_char_class(++nd)) == NULL) { > .. > > Hmmm... is this legal ? > > http://www.eskimo.com/~scs/C-faq/q3.1.html seems to tell otherwise... If it were nd++, yes. However, it is ++nd, thus, the increment happens first, then the call to parse_char_class(), then the assignment to nd. It might be clearer to rewrite this like so however: if ((nd = parse_char_class(nd + 1)) == NULL) { Since that is effectively what it is doing. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message