This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.)

Thoughts?

		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]