From: Vincent Lefevre <vincent@vinc17.org>
To: zsh-workers@zsh.org
Subject: Re: PATCH: Errors compiling on HP-UX with HP's compiler
Date: Mon, 20 Dec 2010 09:57:14 +0100 [thread overview]
Message-ID: <20101220085714.GX1727@prunille.vinc17.org> (raw)
In-Reply-To: <20101220060037.GA14117@sverige>
On 2010-12-20 06:00:37 +0000, Paul Ackersviller wrote:
> I must be using gcc more often than not to have just run across this.
> HP's compiler, I think rightly, refuses to do arithmetic on these two
> void pointers. Does gcc treat them as char * for that purpose?
This is a well-known GCC extension:
5.21 Arithmetic on `void'- and Function-Pointers
================================================
In GNU C, addition and subtraction operations are supported on pointers
to `void' and on pointers to functions. This is done by treating the
size of a `void' or of a function as 1.
A consequence of this is that `sizeof' is also allowed on `void' and
on function types, and returns 1.
The option `-Wpointer-arith' requests a warning if these extensions
are used.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)
next prev parent reply other threads:[~2010-12-20 9:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-20 6:00 Paul Ackersviller
2010-12-20 8:57 ` Vincent Lefevre [this message]
2010-12-20 10:07 ` Peter Stephenson
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=20101220085714.GX1727@prunille.vinc17.org \
--to=vincent@vinc17.org \
--cc=zsh-workers@zsh.org \
/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).