From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 22 14:22:06 2005 Return-Path: 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 9F89116A4D1 for ; Tue, 22 Feb 2005 14:22:06 +0000 (GMT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id E602943D4C for ; Tue, 22 Feb 2005 14:22:05 +0000 (GMT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id F30DA530C; Tue, 22 Feb 2005 15:22:03 +0100 (CET) Received: from xps.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id C349D5308; Tue, 22 Feb 2005 15:21:33 +0100 (CET) Received: by xps.des.no (Postfix, from userid 1001) id 4711933C3E; Tue, 22 Feb 2005 15:21:33 +0100 (CET) To: Giorgos Keramidas References: <4218B960.1050403@kaqelectronics.dyndns.org> <20050220183219.GK57256@cirb503493.alcatel.com.au> <4218DEC5.1080600@kaqelectronics.dyndns.org> <20050221065844.GB81063@cirb503493.alcatel.com.au> <4219C912.2070207@kaqelectronics.dyndns.org> <20050221165951.GA2124@gothmog.gr> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Tue, 22 Feb 2005 15:21:33 +0100 In-Reply-To: <20050221165951.GA2124@gothmog.gr> (Giorgos Keramidas's message of "Mon, 21 Feb 2005 18:59:51 +0200") Message-ID: <86is4kad5e.fsf@xps.des.no> User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on flood.des.no X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL,FORGED_RCVD_HELO autolearn=disabled version=3.0.1 cc: freebsd-hackers@freebsd.org cc: Kathy Quinlan Subject: Re: Error in my C programming X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Feb 2005 14:22:06 -0000 Giorgos Keramidas writes: > The quotations seem a bit messed up, so I don't know if Peter Jeremy or > Kathy Quinlan wrote the above paragraph. Whoever the author was though, > it may be worth to note that C99 *does* allow single-line comments > delimited by //. which leads to the following code being well-formed and well-defined in both C89 and C99 but having different semantics... #include int main(void) { int a, b, c; a =3D 10; b =3D 2; c =3D a //* oops! */ -b; switch (c) { case 8: printf("C99 or C++\n"); break; case -5: printf("C89\n"); break; default: printf("can't happen\n"); break; } return 0; } This is actually documented in the C99 rationale. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no