devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] dtc: check.c fix compile error
Date: Thu, 8 Jun 2017 14:37:30 +1000	[thread overview]
Message-ID: <20170608043730.GA25805@umbus.fritz.box> (raw)
In-Reply-To: <db3a0ff9-bea2-4f6f-a1d6-34e8bc7ff44c-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2625 bytes --]

On Wed, Jun 07, 2017 at 12:46:52PM -0600, Shuah Khan wrote:
> Hi David,
> 
> On 05/16/2017 08:12 PM, David Gibson wrote:
> > On Tue, May 16, 2017 at 10:08:08AM -0600, Shuah Khan wrote:
> >> Fix the following compile error found on odroid-xu4:
> >>
> >> checks.c: In function ‘check_simple_bus_reg’:
> >> checks.c:876:41: error: format ‘%lx’ expects argument of type
> >> ‘long unsigned int’, but argument 4 has type
> >> ‘uint64_t{aka long long unsigned int}’ [-Werror=format=]
> >>   snprintf(unit_addr, sizeof(unit_addr), "%lx", reg);
> >>                                          ^
> >> checks.c:876:41: error: format ‘%lx’ expects argument of type
> >> ‘long unsigned int’, but argument 4 has type
> >> ‘uint64_t {aka long long unsigned int}’ [-Werror=format=]
> >> cc1: all warnings being treated as errors
> >> Makefile:304: recipe for target 'checks.o' failed
> >> make: *** [checks.o] Error 1
> >>
> >> Signed-off-by: Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
> > 
> > The bug is real, but the fix is only correct for some platforms (just
> > as the original would only compile for some platforms).  I've adjusted
> > to %zx which should be right for all platforms and applied.
> This patch with %zx made it into Linux 4.12-rc4 and I am seeing these
> warnings:
> 
>   HOSTCC  scripts/dtc/checks.o
> scripts/dtc/checks.c: In function ‘check_simple_bus_reg’:
> scripts/dtc/checks.c:876:41: warning: format ‘%zx’ expects argument of type ‘size_t’, but argument 4 has type ‘uint64_t {aka long long unsigned int}’ [-Wformat=]
>   snprintf(unit_addr, sizeof(unit_addr), "%zx", reg);
>                                          ^
> scripts/dtc/checks.c:876:41: warning: format ‘%zx’ expects argument of type ‘size_t’, but argument 4 has type ‘uint64_t {aka long long unsigned int}’ [-Wformat=]
>   HOSTLD  scripts/dtc/dtc
>   CHK     scripts/mod/devicetable-offsets.h
> 
> 
> build doesn't fail, which is good. This probably needs fixing,
> but since my fix using %llx fails on some platforms, I am just
> reporting the problem, instead of attempting to fix.

*facepalm*

Sorry.  I "corrected" your patch from one wrong thing to a different
wrong thing.  Apparently I thought the parameter was of type size_t,
rather than uint64_t.

I've now fixed this in my master branch.  This time for sure.  I hope.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      parent reply	other threads:[~2017-06-08  4:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 16:08 [PATCH] dtc: check.c fix compile error Shuah Khan
     [not found] ` <20170516160808.8075-1-shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2017-05-17  2:12   ` David Gibson
     [not found]     ` <20170517021218.GC15596-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2017-05-17 13:42       ` Shuah Khan
2017-06-07 18:46       ` Shuah Khan
     [not found]         ` <db3a0ff9-bea2-4f6f-a1d6-34e8bc7ff44c-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2017-06-08  4:37           ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170608043730.GA25805@umbus.fritz.box \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).