public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Chris Croswhite" <ccroswhite@get2chip.com>
To: <gcc-help@gcc.gnu.org>
Subject: c++, gcc3.2.2 and bitwise operations
Date: Wed, 19 Feb 2003 01:36:00 -0000	[thread overview]
Message-ID: <43834.64.169.83.2.1045618399.squirrel@webmail01.get2chip.com> (raw)

How can I play with the guts of a variable one bit at a time in c++?  That
is, I want to do something like this,

long long val =0x4000000000000001;
((int*)(&val)[1]) &= 0x0;

(this should set the first bit to zero).  This worked with gcc 2.95.x, but I
understand now that the casting (&val)[1] (to an array) is "undefined" and
therefore not predictible.

Could anyone give me hand?

TIA,
Chris


             reply	other threads:[~2003-02-19  1:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-19  1:36 Chris Croswhite [this message]
2003-02-19 11:56 ` Sebastian Huber
2003-02-19 12:25 ` Nathan Sidwell
2003-02-19 13:08 ` John 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=43834.64.169.83.2.1045618399.squirrel@webmail01.get2chip.com \
    --to=ccroswhite@get2chip.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).