From owner-freebsd-hackers Fri Jun 8 7:10: 3 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp.popsite.net (smtp.popsite.net [216.126.128.17]) by hub.freebsd.org (Postfix) with ESMTP id 3CF9637B405 for ; Fri, 8 Jun 2001 07:09:59 -0700 (PDT) (envelope-from bill@twwells.com) Received: from twwells.com (01-051.051.popsite.net [64.24.21.51]) by smtp.popsite.net (Postfix) with ESMTP id 4C29950899 for ; Fri, 8 Jun 2001 09:09:46 -0500 (CDT) Received: from bill by twwells.com with local (Exim 3.22 #1) id 158MxL-0004BT-00; Fri, 08 Jun 2001 10:09:43 -0400 Subject: Re: free() and const warnings To: roam@orbitel.bg (Peter Pentchev) Date: Fri, 8 Jun 2001 10:09:43 -0400 (EDT) Cc: freebsd-hackers@freebsd.org In-Reply-To: <20010608155527.D7671@ringworld.oblivion.bg> from "Peter Pentchev" at Jun 08, 2001 03:55:28 PM X-Mailer: ELM [version 2.5 PL5] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: From: "T. William Wells" 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 > Errrr.. this was the whole point of this thread. I *can't* cast > a (const char *) to a (char *) when using the -Wcast-qual gcc flag - Not all -W options are equally useful and some are actively harmful. This is one of them. There are several situations where it is necessary to remove a qualifier (any code for strchr, e.g.). Adding nonportable hacks to your code to avoid a gcc error message is just plain bad coding. Perhaps gcc has a way to turn off warnings temporarily; I haven't checked lately. If not, roll your own. Define a comment like /*CASTOK*/, to stick on each line with such a cast, then filter the gcc output using a script that examines the source code for such comments and removes the bogus error messages. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message