From: Paul Eggert <eggert@cs.ucla.edu>
To: Roland McGrath <roland@hack.frob.com>
Cc: Joseph Myers <joseph@codesourcery.com>, libc-alpha@sourceware.org
Subject: Re: Add macros for diagnostic control, use them in locale/weightwc.h
Date: Tue, 18 Nov 2014 22:29:00 -0000 [thread overview]
Message-ID: <546BC831.2010006@cs.ucla.edu> (raw)
In-Reply-To: <20141118211808.2053D2C3B22@topped-with-meat.com>
On 11/18/2014 01:18 PM, Roland McGrath wrote:
> We should only ever disable warnings with the
> tightest possible scope around where we know for sure we need to.
In that case neither my patch nor Joseph's should be accepted. If I
understand Joseph's patch correctly,the maybe-uninitialized warning
needs to be disabled only when dereferencing'cp'. For example, in the
expression 'cp[cnt]', the warning should be disabled only for the load
from 'cp[cnt]'; it should not be disabled for the load from 'cp' itself,
or for the load from 'cnt'. So Joseph's proposed patch doesn't have a
tight scope here. It should be possible to tighten itto cover only the
places where troublesome dereferences actually occur, e.g., by defining
a macro 'NO_MAYBE_UNINITIALIZED_DEREFERENCE (p)' that suppresses the
warning while dereferencing the pointer P, by using
'NO_MAYBE_UNINITIALIZED_DEREFERENCE (cp + cnt)' in place of 'cp[cnt]', etc.
Also, as I understand it the warning should be disabled only on x86-64,
and only if optimization is enabled, as we don't know of problems with
other platforms or when optimization is turned off.
There may be other ways to tighten the scope, too.
However, I'm still not convinced that it's worth the trouble to insist
on tight scopes like this. Many of these bogus warnings are due to
compiler bugs; I'm afraid we've seen this too often in gnulib, when
supporting projects that use -Werror. If we start worrying about tight
scopes for workarounds for GCC cry-wolf bugs, we will too easily go down
the rabbit hole of maintaining a fragile and evolving list of GCC
compiler bugs rather than maintaining glibc.
next prev parent reply other threads:[~2014-11-18 22:29 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 18:04 Joseph Myers
2014-11-18 20:53 ` Paul Eggert
2014-11-18 21:18 ` Roland McGrath
2014-11-18 22:29 ` Paul Eggert [this message]
2014-11-18 23:16 ` Joseph Myers
2014-11-18 23:58 ` Paul Eggert
2014-11-19 0:06 ` Joseph Myers
2014-11-19 6:52 ` Paul Eggert
2014-11-19 9:09 ` Andreas Schwab
2014-11-19 15:42 ` Joseph Myers
2014-11-18 23:00 ` Joseph Myers
2014-11-18 23:49 ` Paul Eggert
2014-11-19 0:03 ` Joseph Myers
2014-11-19 6:51 ` Paul Eggert
2014-11-19 14:56 ` Joseph Myers
2014-11-21 17:29 ` Paul Eggert
2014-11-21 18:27 ` Joseph Myers
2014-11-21 17:05 ` Joseph Myers
2014-11-21 17:43 ` Paul Eggert
2014-11-21 18:12 ` Joseph Myers
2014-11-21 19:17 ` Paul Eggert
2014-11-21 22:47 ` Joseph Myers
2014-11-21 23:03 ` Joseph Myers
2014-11-22 5:14 ` Paul Eggert
2014-11-24 23:47 ` Roland McGrath
2014-11-25 1:29 ` Joseph Myers
2014-11-25 22:35 ` Paul Eggert
2014-11-25 22:42 ` Joseph Myers
2014-11-26 0:24 ` Paul Eggert
2014-11-26 0:36 ` Joseph Myers
2014-11-26 0:42 ` Paul Eggert
2014-11-25 22:42 ` Roland McGrath
2014-11-25 0:00 ` Roland McGrath
2014-11-25 22:23 ` Paul Eggert
2014-11-21 22:29 ` Roland McGrath
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=546BC831.2010006@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
--cc=roland@hack.frob.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).