linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Binderman <linuxdev.baldrick@gmail.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: benh@kernel.crashing.org, paulus@samba.org,
	linuxppc-dev@lists.ozlabs.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dcb314@hotmail.com
Subject: Re: arch/powerpc/xmon/dis-asm.h: 2 * wrong specifiers ?
Date: Tue, 28 Jun 2016 08:06:56 +0100	[thread overview]
Message-ID: <CAMzoambZ9wu3orkFfYemTQiMpf+OWPdk8v6_SXsJapS74HE13A@mail.gmail.com> (raw)
In-Reply-To: <1467086888.32607.9.camel@ellerman.id.au>

Hello there,

On Tue, Jun 28, 2016 at 5:08 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> What config / toolchain are you using? I've never seen these.

A static analyser for C & C++ called cppcheck. Available from sourceforge.

I think you can also get a similar warning if you tweek the gcc compiler warning
flags. -Wformat=2 maybe.

>> static inline int print_insn_powerpc(unsigned long insn, unsigned long memaddr)
>> {
>>     printf("%.8x", insn);
>>     return 0;
>> }
>
> Send me a patch to cast insn to unsigned int?

I don't know the code, but given that insn is unsigned long and so can go
past 32 bits, using a cast to unsigned int might throw away the
possibly important
upper bits.


Regards

David Binderman

  reply	other threads:[~2016-06-28  7:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27  8:04 arch/powerpc/xmon/dis-asm.h: 2 * wrong specifiers ? David Binderman
2016-06-28  4:08 ` Michael Ellerman
2016-06-28  7:06   ` David Binderman [this message]
2016-06-28  7:17     ` Michael Ellerman
2016-06-28  7:30     ` Segher Boessenkool
2016-06-28  9:35     ` Benjamin Herrenschmidt

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=CAMzoambZ9wu3orkFfYemTQiMpf+OWPdk8v6_SXsJapS74HE13A@mail.gmail.com \
    --to=linuxdev.baldrick@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=dcb314@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.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).