From: Dan Pop <Dan.Pop@cern.ch>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] integer -> pointer question
Date: Mon, 31 Jul 2000 23:20:02 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590678205255@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590678205250@msgid-missing>
On Mon, 31 Jul 2000, Michael Madore wrote:
> > If you want to shut up such warnings, do what gcc suggests: cast the
> > integer to void *.
>
> Sorry, my original post was a little unclear. The compiler spits out a
> warning even if the programmer uses a cast.
I can't reproduce this behaviour here:
pcpole65:~ 0 15> gcc -v
Reading specs from /usr/local/lib/gcc-lib/ia64-unknown-linux/2.9-ia64-000216-final/specs
gcc version 2.9-ia64-000216-final
pcpole65:~ 0 16> cat test.c
int main()
{
void *p = (void *)123;
return 0;
}
pcpole65:~ 0 17> gcc test.c
pcpole65:~ 0 18>
But if it happens with your toolchain, the logical fix would be to cast
the integer to long before casting it to void *. Or, if it's a plain
integer constant, just use the 'L' suffix. This shouldn't cause any
problems on 32-bit platforms, where int's and long's have the same size.
Dan
next prev parent reply other threads:[~2000-07-31 23:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-07-31 22:22 [Linux-ia64] integer -> pointer question Michael Madore
2000-07-31 22:34 ` Jes Sorensen
2000-07-31 23:03 ` Dan Pop
2000-07-31 23:14 ` Michael Madore
2000-07-31 23:16 ` Michael Madore
2000-07-31 23:20 ` Dan Pop [this message]
2000-07-31 23:21 ` David Mosberger
2000-08-01 0:49 ` Jes Sorensen
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=marc-linux-ia64-105590678205255@msgid-missing \
--to=dan.pop@cern.ch \
--cc=linux-ia64@vger.kernel.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