This is the mail archive of the gcc-patches@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]

Re: C++ Patch: possible bug pointed out by non-literal format warning


On Thu, 27 Jan 2000 13:55:22 -0800, Richard Henderson wrote:
> On Thu, Jan 27, 2000 at 03:30:47PM -0500, Kaveh R. Ghazi wrote:
> > -           if (!format[0])
> > -             sprintf (format, "%%x%%0%dx", HOST_BITS_PER_INT / 4);
> 
> Perhaps more of the same hackery?
> 
>         sprintf (format, "%s%%0%d%s", HOST_WIDE_INT_PRINT_HEX,
>                  HOST_BITS_PER_WIDE_INT / 4,
>                  strchr (HOST_WIDE_INT_PRINT_HEX, '%')+1);

Not quite right for c4x.  You'll get an extra `h'

config/c4x/c4x.h:#  define HOST_WIDE_INT_PRINT_HEX "0%xh"
config/c4x/c4x.h:#   define HOST_WIDE_INT_PRINT_HEX "0%lxh"
config/c4x/c4x.h:#   define HOST_WIDE_INT_PRINT_HEX "0%llxh"




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