From: Michael Ellerman <mpe@ellerman.id.au>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
linuxppc-dev@lists.ozlabs.org
Cc: paulus@samba.org
Subject: Re: Shift overflow warnings in arch/powerpc/boot/addnote.c on 32-bit builds
Date: Wed, 20 Mar 2019 23:45:44 +1100 [thread overview]
Message-ID: <874l7xzpc7.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <c6ba8992-a3f3-2c99-6d6d-7ee9d41a22c5@ilande.co.uk>
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> writes:
> Hi all,
>
> Whilst building the latest git master on my G4 I noticed the following shift overflow
> warnings in the build log for arch/powerpc/boot/addnote.c:
>
>
> arch/powerpc/boot/addnote.c: In function ‘main’:
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
I don't think there's any situation in which a 32-bit addnote will be
run against a 64-bit ELF is there?
So I don't think there's an actual bug, but it would be good if we could
make the warning go away.
cheers
prev parent reply other threads:[~2019-03-20 12:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-19 7:10 Shift overflow warnings in arch/powerpc/boot/addnote.c on 32-bit builds Mark Cave-Ayland
2019-03-19 8:45 ` Christophe Leroy
2019-03-19 10:21 ` Cédric Le Goater
2019-03-20 12:45 ` Michael Ellerman [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=874l7xzpc7.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mark.cave-ayland@ilande.co.uk \
--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