From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: Brad Lucier <lucier@math.purdue.edu>
Cc: gcc@gcc.gnu.org
Subject: Re: strict-aliasing and typedefs
Date: Wed, 14 May 2003 21:08:00 -0000 [thread overview]
Message-ID: <m37k8tjkxg.fsf@uniton.integrable-solutions.net> (raw)
In-Reply-To: <200305142056.h4EKujuX025820@banach.math.purdue.edu>
Brad Lucier <lucier@math.purdue.edu> writes:
| I've read the documentation and done a google and gcc search, but
| I still have this question.
|
| If I have the typedefs and variables
|
| typedef int stackslot;
| typedef int heapslot;
|
| stackslot *sp;
| heapslot *hp;
|
| then can sp and hp point to the same location in memory with
| ISO C's aliasing rules?
Yes, that is because typedef-name acts like a keyword that is
synonymous for the original type, hence sp and hp can alias the same
object.
| I'm wondering if a Scheme->C compiler
| can use typedefs and ISO C's aliasing rules to tell gcc that certain
| memory locations cannot alias each other.
No, a typedef does not introduce a distinct type: It just introduces a
new type-name -- it is all syntactical.
-- Gaby
next prev parent reply other threads:[~2003-05-14 21:08 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-14 20:56 Brad Lucier
2003-05-14 21:07 ` Fergus Henderson
2003-05-14 21:28 ` Gabriel Dos Reis
2003-05-14 21:08 ` Gabriel Dos Reis [this message]
2003-05-14 21:21 ` Joe Buck
2003-05-14 21:30 ` Gabriel Dos Reis
2003-05-14 21:41 ` Joe Buck
2003-05-14 21:53 ` Gabriel Dos Reis
2003-05-14 22:17 ` Gabriel Dos Reis
2003-05-14 22:29 ` two-element struct performance (was: strict-aliasing and typedefs) Joe Buck
2003-05-14 22:49 ` Gabriel Dos Reis
2003-05-14 23:06 ` Joe Buck
2004-02-20 0:43 ` law
2004-02-20 9:06 ` Richard Henderson
2004-02-20 15:21 ` law
2004-02-24 6:19 ` law
2004-02-24 10:29 ` Gabriel Dos Reis
2004-02-24 10:44 ` Paolo Carlini
2003-05-14 21:21 ` strict-aliasing and typedefs Andreas Schwab
2003-05-14 21:32 ` Gabriel Dos Reis
2003-05-14 21:46 ` Brad Lucier
2003-05-14 21:56 ` Gabriel Dos Reis
2003-05-14 21:47 ` Daniel Jacobowitz
2003-05-14 21:59 ` Gabriel Dos Reis
2003-05-14 22:04 ` Daniel Jacobowitz
2003-05-14 22:07 ` Brad Lucier
2003-05-14 22:11 ` Gabriel Dos Reis
2003-05-14 21:38 Robert Dewar
2003-05-14 23:10 Robert Dewar
2003-05-14 23:14 ` Joe Buck
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=m37k8tjkxg.fsf@uniton.integrable-solutions.net \
--to=gdr@integrable-solutions.net \
--cc=gcc@gcc.gnu.org \
--cc=lucier@math.purdue.edu \
/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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).