Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719373

Re: [PATCH] [RFC] ARM: vdso: work around gcc-8 warning

From Russell King - ARM Linux <linux@armlinux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH] [RFC] ARM: vdso: work around gcc-8 warning
Date 2017-08-24 18:10 +0200
Message-ID <ui2RJ-kG-51@gated-at.bofh.it> (permalink)
References <uhEw1-1x1-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] [RFC] ARM: vdso: work around gcc-8 warning Arnd Bergmann <arnd@arndb.de> - 2017-08-23 16:10 +0200
  Re: [PATCH] [RFC] ARM: vdso: work around gcc-8 warning Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-08-23 16:10 +0200
    Re: [PATCH] [RFC] ARM: vdso: work around gcc-8 warning Mark Rutland <mark.rutland@arm.com> - 2017-08-23 16:20 +0200
      Re: [PATCH] [RFC] ARM: vdso: work around gcc-8 warning Arnd Bergmann <arnd@arndb.de> - 2017-08-23 16:20 +0200
  Re: [PATCH] [RFC] ARM: vdso: work around gcc-8 warning Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-08-24 18:10 +0200

csiph-web