From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
To: rth@cygnus.com
Cc: egcs@cygnus.com
Subject: Re: Is there a HOST_BITS_PER_POINTER macro?
Date: Fri, 06 Feb 1998 08:48:00 -0000 [thread overview]
Message-ID: <199802061648.LAA11516@caip.rutgers.edu> (raw)
> From: Richard Henderson <rth@dot.cygnus.com>
>
> On Thu, Feb 05, 1998 at 07:45:09PM -0500, Kaveh R. Ghazi wrote:
> > I get a warning from "-W -Wall" which complains about int format vs
> > pointer argument. Is there a way to define a macro in machmode.h
> > which can cast the pointer to the appropriately sized integer type?
>
> Ideally you would use "%p" everywhere, but to support bootstrapping,
> we should probably autoconf a test for that.
> r~
Good point. I guess it would have to be a runtime check of the
*printf functions in libc. How about using code like this?
> #include <stdio.h>
> main()
> {
> char foo[30];
> char * ptr = (char *) 0;
>
> sprintf(foo, "%p", ptr)
> exit (strcmp(foo, "0"));
> }
and then doing AC_DEFINE(HOST_PTR_PRINTF, "%p") if it passes?
(machmode.h won't define it if its already defined.)
If you think the test is sufficient, I'll whip up a patch.
--Kaveh
--
Kaveh R. Ghazi Project Manager / Custom Development
ghazi@caip.rutgers.edu ICon CMT Corp.
next reply other threads:[~1998-02-06 8:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-02-06 8:48 Kaveh R. Ghazi [this message]
1998-02-10 3:34 ` Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
1998-02-07 13:09 Kaveh R. Ghazi
1998-02-07 13:29 ` Richard Henderson
1998-02-05 16:45 Kaveh R. Ghazi
1998-02-05 22:09 ` Richard Henderson
1998-02-06 0:57 ` Jeffrey A Law
1998-02-05 22:09 ` Joern Rennecke
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=199802061648.LAA11516@caip.rutgers.edu \
--to=ghazi@caip.rutgers.edu \
--cc=egcs@cygnus.com \
--cc=rth@cygnus.com \
/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).