public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: linux@armlinux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] [RFC] ARM: vdso: work around gcc-8 warning
Date: Thu, 24 Aug 2017 17:06:33 +0100	[thread overview]
Message-ID: <20170824160633.GW20805@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20170823140538.1590432-1-arnd@arndb.de>

On Wed, Aug 23, 2017 at 04:05:26PM +0200, Arnd Bergmann wrote:
> gcc-8 correctly points out that reading four bytes from a pointer to a
> 'char' variable is wrong
> 
> arch/arm/kernel/vdso.c: In function 'vdso_init':
> arch/arm/kernel/vdso.c:200:6: error: '__builtin_memcmp_eq' reading 4 bytes from a region of size 1 [-Werror=stringop-overflow=]
> 
> However, in this case the variable just stands for the beginning of the
> vdso and is not actually a 'char', so the code is doing what it is meant
> to do.
> 
> Not sure what the best solution for this is, changing the hack to
> declare the variable as 'int' instead makes the warning go away.

Well, one way to look at the code is an array of characters, so
we could say that it should be:

extern char vdso_start[], vdso_end[];

which is exactly the same construct that we use for _stext and
similar.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

      parent reply	other threads:[~2017-08-24 16:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23 14:05 [PATCH] [RFC] ARM: vdso: work around gcc-8 warning Arnd Bergmann
2017-08-23 14:07 ` Ard Biesheuvel
2017-08-23 14:11   ` Mark Rutland
2017-08-23 14:15     ` Arnd Bergmann
2017-08-24 16:06 ` Russell King - ARM Linux [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=20170824160633.GW20805@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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