[lldb-dev] Patch for addressing format warnings on 32-bit

William Dillon via lldb-dev lldb-dev at lists.llvm.org
Sun Dec 27 12:32:26 PST 2015


> Message: 1
> Date: Sat, 26 Dec 2015 21:15:53 +0100
> From: Joerg Sonnenberger via lldb-dev <lldb-dev at lists.llvm.org>
> To: lldb-dev at lists.llvm.org
> Subject: Re: [lldb-dev] Patch for addressing format warnings on 32-bit
> Message-ID: <20151226201553.GB14119 at britannica.bec.de>
> Content-Type: text/plain; charset=utf-8
> 
> On Fri, Dec 25, 2015 at 06:34:09PM -0800, William Dillon via lldb-dev wrote:
>> There are a handful of -Wformat warnings on 32-bit platforms.
>> I addressed all those that I’ve seen while working on Swift.
>> Let me know if the git diff format is inappropriate for this.
> 
> Don't cast size_t to uint64_t, format it with %zu directly.
> 
> Joerg
> 

I can go ahead and do that, but I wonder whether there should be two different ways of handling this, even on the same line.  For example:

-            error.SetErrorStringWithFormat ("SoftwareBreakpointr::%s addr=0x%" PRIx64 ": tried to read %lu bytes but only read %" PRIu64, __FUNCTION__, m_addr, m_opcode_size, (uint64_t)bytes_read);
+            error.SetErrorStringWithFormat ("SoftwareBreakpointr::%s addr=0x%" PRIx64 ": tried to read %" PRIu64 " bytes but only read %" PRIu64, __FUNCTION__, m_addr, (uint64_t)m_opcode_size, (uint64_t)bytes_read);

- Will


More information about the lldb-dev mailing list