From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26248 invoked from network); 12 Aug 2005 10:29:59 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 12 Aug 2005 10:29:59 -0000 Received: (qmail 73938 invoked from network); 12 Aug 2005 10:29:52 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Aug 2005 10:29:52 -0000 Received: (qmail 28409 invoked by alias); 12 Aug 2005 10:29:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21604 Received: (qmail 28400 invoked from network); 12 Aug 2005 10:29:50 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 12 Aug 2005 10:29:50 -0000 Received: (qmail 73684 invoked from network); 12 Aug 2005 10:29:50 -0000 Received: from mailhost1.csr.com (HELO MAILSWEEPER01.csr.com) (81.105.217.43) by a.mx.sunsite.dk with SMTP; 12 Aug 2005 10:29:45 -0000 Received: from exchange03.csr.com (unverified [10.100.137.60]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Fri, 12 Aug 2005 11:27:35 +0100 Received: from news01 ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC (5.0.2195.6713); Fri, 12 Aug 2005 11:29:37 +0100 Date: Fri, 12 Aug 2005 11:29:42 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: PATCH: silencing compiler warnings from gcc 4 Message-Id: <20050812112942.55b42d24.pws@csr.com> In-Reply-To: <20050811200252.GA19497@blorf.net> References: <20050811200252.GA19497@blorf.net> Organization: Cambridge Silicon Radio X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 12 Aug 2005 10:29:37.0298 (UTC) FILETIME=[BD46F720:01C59F28] X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 Wayne Davison wrote: > Gcc 4 outputs a bunch of compiler warnings about string pointers that > differ in signedness. The warnings in a zsh build are limited to the > zle string functions defined in zle.h. I came up with 2 solutions: > (1) change the ZS_str* macros to cast their args to (char*), or (2) > introduce some static inline functions to handle the casts. The > advantage of the latter is that it doesn't hide pointer-conversion > errors behind forced casts. For instance, after I compiled the inline > version it showed several places in the code that were using ZWC() on > strings instead of ZWS() (which I already fixed and checked in). I was wondering about these. I'm a bit loath either to cast away any typesafety quite so blithely as the first change would do, but I'm not that keen on putting too much work into non-standard features (which will reduce to the first case where inline isn't available). I believe even C99 doesn't allow every use of inline that gcc does. However, given that we're stuck with casts of some sort, and we do a lot of the development with gcc, possibly the second option is the best way to go. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. **********************************************************************