This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Top-of-tree GCC/glibc build problem
- From: Florian Weimer <fweimer at redhat dot com>
- To: Steve Ellcey <sellcey at marvell dot com>
- Cc: "libc-alpha\@sourceware.org" <libc-alpha at sourceware dot org>, Martin Sebor <msebor at redhat dot com>, Jeff Law <law at redhat dot com>
- Date: Mon, 07 Oct 2019 18:05:22 +0200
- Subject: Re: Top-of-tree GCC/glibc build problem
- References: <db63aef83bfdb68cefbbb78d53ca2f24d31939f1.camel@marvell.com>
* Steve Ellcey:
> Looks like we have another new warning that is blocking top-of-tree glibc
> from being built with top-of-tree gcc. Would using 'cp[0]' instead of '*cp'
> be the right fix here?
>
> Steve Ellcey
> sellcey@marvell.com
>
>
> zic.c: In function ‘inzsub’:
> zic.c:1369:23: error: writing 8 bytes into a region of size 1 [-Werror=stringop-overflow=]
> 1369 | z.z_format_specifier = cp ? *cp : '\0';
> | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
> zic.c:124:8: note: destination object declared here
> 124 | char z_format_specifier;
> | ^~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> ../o-iterator.mk:9: recipe for target '/home/sellcey/tot/obj-glibc/timezone/zic.o' failed
This looks like a GCC bug to me. The code is okay: no aliases,
zero-length arrays, or anything like that. The store has size 1, too.
Is it possible that the stringop-overflow diagnostic pass runs after
some sort of store-merging pass? In this case, many of the diagnostics
would need to be suppressed.
Thanks,
Florian