zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: silencing compiler warnings from gcc 4
Date: Fri, 12 Aug 2005 11:29:42 +0100	[thread overview]
Message-ID: <20050812112942.55b42d24.pws@csr.com> (raw)
In-Reply-To: <20050811200252.GA19497@blorf.net>

Wayne Davison <wayned@users.sourceforge.net> 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 <pws@csr.com>                  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.

**********************************************************************


  reply	other threads:[~2005-08-12 10:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-11 20:02 Wayne Davison
2005-08-12 10:29 ` Peter Stephenson [this message]
2005-08-12 11:31 ` Peter Stephenson
2005-08-12 13:27   ` Wayne Davison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050812112942.55b42d24.pws@csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).