From: Linus Torvalds <torvalds@linux-foundation.org>
To: Christopher Li <sparse@chrisli.org>, linux-sparse@vger.kernel.org
Subject: Turn off '-Wtransparent-union' by default
Date: Thu, 18 Jun 2009 09:52:49 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.2.01.0906180951570.16802@localhost.localdomain> (raw)
In-Reply-To: <alpine.LFD.2.01.0906180940490.16802@localhost.localdomain>
It's a very annoying warning, and it's about a sparse limitation rather
than a real feature, so don't do it by default.
Sure, our lack of transparent union support will then make us warn about
the magic calling convention hacks (eg you'll see warnings like
connect.c:240:39: warning: incorrect type in argument 2 (invalid types)
connect.c:240:39: expected union __CONST_SOCKADDR_ARG [usertype] __addr
connect.c:240:39: got struct sockaddr *ai_addr
but it still doesn't mean that we have to be so noisy about just seeing
those transparent unions. One annoying warning is not an argument for
doing _another_ annoying warning too (and the calling convention
warnings at least only happen if you actually use them, unlike the
transparent union warning that happens every time we see one, used or
not).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
lib.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib.c b/lib.c
index 2b8d21e..42affcd 100644
--- a/lib.c
+++ b/lib.c
@@ -206,7 +206,7 @@ int Wparen_string = 0;
int Wptr_subtraction_blows = 0;
int Wreturn_void = 0;
int Wshadow = 0;
-int Wtransparent_union = 1;
+int Wtransparent_union = 0;
int Wtypesign = 0;
int Wundef = 0;
int Wuninitialized = 1;
next prev parent reply other threads:[~2009-06-18 16:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-18 16:44 Allow array declarators to have 'restrict' in them Linus Torvalds
2009-06-18 16:52 ` Linus Torvalds [this message]
2009-06-18 17:41 ` Avoid "attribute 'warning': unknown attribute" warning Linus Torvalds
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=alpine.LFD.2.01.0906180951570.16802@localhost.localdomain \
--to=torvalds@linux-foundation.org \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.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;
as well as URLs for NNTP newsgroup(s).