https://bugs.kde.org/show_bug.cgi?id=433510

--- Comment #6 from Julian Seward <jsew...@acm.org> ---
(In reply to Mark Wielaard from comment #5)
> (In reply to Paul Floyd from comment #4)
> > > -         TRACE_SYMTAB("rx_map:  avma %#lx   size %lu  foff %ld\n",
> > > +         TRACE_SYMTAB("rx_map:  avma %#lx   size %lu  foff %lld\n",
> > 
> > ^^^ generates warnings
> > 
> > I think that both versions probably generate warnings on either 32bit or
> > 64bit systems, and that we should use a macro to choose l or ll.
> 
> I don't think so. I believe the actual pointers and offsets are either
> 32/64bit already and match the lx/lu/ld directives.

As a general comment, the way I've handled these problems in the past is
simply to cast the relevant values to the widest possible type -- a 64-bit
signed or unsigned int (Long or ULong) and then used %lld, %llx, etc.  That
makes the problem go away without need of macros or other complexity,
although you do have to be a bit careful about whether the cast requires
signed or unsigned widening.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to