From: Andy Howell <spam-andy-be-howell-gone@austin.rr.com>
To: gcc-help@gcc.gnu.org
Subject: pointer arithmetic for alignment on short or int boundry
Date: Sun, 21 Sep 2003 13:56:00 -0000 [thread overview]
Message-ID: <3F6DAD38.4060101@austin.rr.com> (raw)
I need to calculate an address on a short or int boundry. For some
reason this is not working:
char *a;
a = (a + 1) & ((char*) -2));
Gcc 3.3 on Solaris complains:
error: invalid operands of types `char*' and `
char*' to binary `operator&'
Why shouldn't I be able to mask off the low bit?
Thanks,
Andy
next reply other threads:[~2003-09-21 13:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-21 13:56 Andy Howell [this message]
2003-09-21 14:55 ` Burak Serdar
2003-09-21 15:42 ` Andy Howell
2003-09-21 15:40 ` Eljay Love-Jensen
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=3F6DAD38.4060101@austin.rr.com \
--to=spam-andy-be-howell-gone@austin.rr.com \
--cc=gcc-help@gcc.gnu.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.
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).