zsh-workers
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: Peter Stephenson <pws@csr.com>
Cc: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: Strict-aliasing warnings
Date: Thu, 19 Feb 2004 02:50:13 -0800	[thread overview]
Message-ID: <20040219105013.GD26450@blorf.net> (raw)
In-Reply-To: <1728.1077186812@csr.com>

On Thu, Feb 19, 2004 at 10:33:32AM +0000, Peter Stephenson wrote:
> The warning is highly obscure but my guess is it's worried because it
> doesn't know that the type we're looking at really does look like a
> HashNode.

Kind of, but only in the context of modern aliasing restrictions.  If
two aliases for a single memory location differ in type in a radical
enough manner, the compiler does not have to consider that the two
different references might affect one another.  E.g. you could change a
variable from one pointer and not have that change get reflected in the
reading from another pointer (or the original variable) because the
compiler might have optimized away the memory-fetch.  However, certain
casts force the compiler to be less aggressive in its optimizations
(such as (char *) and (void *)).

That is the intent of using the (void *) cast -- it _should_ let the
optimizer know that that variable needs to be refetched.  However, I'm
not 100% sure that this is enough to make sure that the optimizations
are valid or if it's only enough to just silence the warnings.

..wayne..


  reply	other threads:[~2004-02-19 10:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-19 10:20 Wayne Davison
2004-02-19 10:33 ` Peter Stephenson
2004-02-19 10:50   ` Wayne Davison [this message]
2004-02-19 11:04     ` Peter Stephenson
2004-02-26  3:18       ` 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=20040219105013.GD26450@blorf.net \
    --to=wayned@users.sourceforge.net \
    --cc=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).