This is the mail archive of the
mailing list for the GCC project.
Should we eliminate HOST_PTR_PRINTF ?
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 4 Jul 2003 15:35:18 -0400 (EDT)
- Subject: Should we eliminate HOST_PTR_PRINTF ?
I was about to submit a patch to merge adjacent stdio calls containing
HOST_PTR_PRINTF using ISO C string concatenation (similar to what I
did for HOST_WIDE_INT_PRINT_*)
But looking at the definition of HOST_PTR_PRINTF, I see:
> #ifndef HOST_PTR_PRINTF
> # ifdef HAVE_PRINTF_PTR
> # define HOST_PTR_PRINTF "%p"
> # else
> # define HOST_PTR_PRINTF \
> (sizeof (int) == sizeof (char *) ? "%x" \
> : sizeof (long) == sizeof (char *) ? "%lx" : "%llx")
> # endif
> #endif /* ! HOST_PTR_PRINTF */
I'm pretty sure that if autoconf determines "%p" won't work, then the
fallbacks using same-sized-ints will generate -Wformat warnings.
Given that we've had -Werror for a while and no one has complained, I
have to assume that everyone has "%p".
Since in concatenating the stdio calls I have to touch all callers
anyway, I'm wondering should I simply eliminate HOST_PTR_PRINTF and
put in an explicit "%p"?
(If we keep HOST_PTR_PRINTF, then I'll change the same-sized-ints
fallback to a compile-time constant so we can concatenate it.)
Kaveh R. Ghazi email@example.com