This is the mail archive of the
mailing list for the glibc project.
Re: Add macros for diagnostic control, use them in locale/weightwc.h
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Paul Eggert <eggert at cs dot ucla dot edu>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 18 Nov 2014 23:00:18 +0000
- Subject: Re: Add macros for diagnostic control, use them in locale/weightwc.h
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1411181803130 dot 11642 at digraph dot polyomino dot org dot uk> <546BB1B1 dot 50000 at cs dot ucla dot edu>
On Tue, 18 Nov 2014, Paul Eggert wrote:
> Also, the distinction between GCC version "4, 7" (which is checked) and
> version "4.9" (which is not) is bothersome. Inevitably the unchecked version
> numbers will become wrong. If we're going to have a "4.9" at all, we should
> check it.
Checking it means reviewing if the warning still appears when GCC 5
becomes the minimum supported version for building glibc. The relevant
version to compare the 4.9 with is the minimum version for building glibc
(which is not currently available in C code in glibc), not the version
actually being used to build glibc.
> +#pragma GCC diagnostic push
No, as stated in
<https://sourceware.org/ml/libc-alpha/2014-11/msg00326.html> it's desired
to go via internal macros for this.
> +/* Seen on x86_64 (inlined from fnmatch_loop.c:internal_fnwmatch):
> + "'*((void *)&str+4)' may be used uninitialized in this function". */
> +#if __GNUC_PREREQ (4, 7) && !__GNUC_PREPREQ (4, 10)
> +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
No, __GNUC_PREPREQ (4, 10) is wrong. We don't want to introduce lots of
build failures every time GCC branches and the mainline version increases.
We have no evidence that the warning does not appear with GCC 5; the
assertion is simply that it was observed with 4.9.
Joseph S. Myers