From owner-freebsd-questions@FreeBSD.ORG Thu Dec 2 11:27:26 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F213016A4CE for ; Thu, 2 Dec 2004 11:27:26 +0000 (GMT) Received: from nutty.inf.ed.ac.uk (nutty.inf.ed.ac.uk [129.215.216.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id D57E043D39 for ; Thu, 2 Dec 2004 11:27:25 +0000 (GMT) (envelope-from richard@inf.ed.ac.uk) Received: from macintosh.inf.ed.ac.uk (macintosh.inf.ed.ac.uk [129.215.164.64]) by nutty.inf.ed.ac.uk (8.12.8/8.12.8) with ESMTP id iB2BROPj016848; Thu, 2 Dec 2004 11:27:24 GMT Received: by macintosh.inf.ed.ac.uk (Postfix, from userid 501) id 657D21B43BB; Thu, 2 Dec 2004 11:27:24 +0000 (GMT) From: Richard Tobin To: Andrea Venturoli , Rob In-Reply-To: Andrea Venturoli's message of Thu, 02 Dec 2004 10:51:29 +0100 Organization: just say no X-Mailer: Ream 5.1.51-richard-mac Message-Id: <20041202112724.657D21B43BB@macintosh.inf.ed.ac.uk> Date: Thu, 2 Dec 2004 11:27:24 +0000 (GMT) cc: FreeBSD Subject: Re: gcc violates const-ness of variable? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2004 11:27:27 -0000 > IIRC "const" does not exist in *standardized* C... No, it exists in both C89 and C99. But the error is in your program, not the compiler. "const" in C is a promise that you do not change the value, and you break that promise. It may be different in C++, I don't know. For definitive answers, try the newsgroups comp.lang.c and comp.lang.c++ -- Richard