linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Randy Dunlap <rdunlap@xenotime.net>
Cc: Sam Ravnborg <sam@ravnborg.org>,
	Christopher Li <sparse@chrisli.org>,
	Dave Jones <davej@redhat.com>, Al Viro <viro@ftp.linux.org.uk>,
	linux-sparse@vger.kernel.org
Subject: Re: more spewage (Re: sparse segfault on ppc64)
Date: Sat, 24 Mar 2007 10:02:22 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0703240957530.6730@woody.linux-foundation.org> (raw)
In-Reply-To: <20070324094648.60505bd3.rdunlap@xenotime.net>



On Sat, 24 Mar 2007, Randy Dunlap wrote:
> 
> But I would not complain if sparse just read & ignored the
> attributes (rather than throwing errors on them).

Well, sparse is often also an "arbiter of good taste".

"Technically correct" or "..but gcc accepts it" are secondary to "does the 
source make sense".

For example, gcc accepts a *lot* of insanity when it comes to attributes 
in odd places. That doesn't necessarily mean that sparse should accept it.

And any C compiler will accept

	void *ptr = 0;

and that doesn't mean that sparse should accept that mind-boggling bug in 
the C standard. Yes, the zero constant is a special pointer, but it's 
special when cast to a pointer type, not when used as a integer. And the 
fact that the C standard disagrees with me just means that the C standard 
is wrong.

So I don't think sparse should necessarily accept crap code just because 
(a) gcc accepts it and (b) there is some crap code in the kernel that uses 
it. That "__attribute__((unused))" on a label seems to be exactly that 
kind of horror. It's not like it's any prettier than tons of *valid* ways 
to do the same (for example, using the C preprocessor).

			Linus

  reply	other threads:[~2007-03-24 17:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22  6:36 sparse segfault on ppc64 Dave Jones
2007-03-22  7:33 ` Al Viro
2007-03-22  7:03   ` Christopher Li
2007-03-22 12:59     ` Al Viro
2007-03-22 22:16       ` Christopher Li
2007-03-23 23:08       ` [PATCH] Fix the annotated inline call position Christopher Li
2007-04-20 10:09         ` Josh Triplett
2007-03-22 16:04     ` sparse segfault on ppc64 Dave Jones
2007-03-22 17:11     ` Dave Jones
2007-03-22 22:10       ` Christopher Li
2007-03-23 22:04         ` more spewage (Re: sparse segfault on ppc64) Randy Dunlap
2007-03-23 22:57           ` Christopher Li
2007-03-23 23:10           ` [PATCH] handle label attributes Christopher Li
2007-03-25 18:52             ` Randy Dunlap
2007-04-20 10:17             ` Josh Triplett
2007-03-23 23:31           ` more spewage (Re: sparse segfault on ppc64) Sam Ravnborg
2007-03-23 23:01             ` Christopher Li
2007-03-23 23:43             ` Randy Dunlap
2007-03-24  6:44               ` Sam Ravnborg
2007-03-24 16:46                 ` Randy Dunlap
2007-03-24 17:02                   ` Linus Torvalds [this message]
2007-03-26 18:07                     ` Christopher Li
2007-03-26 18:50                       ` Randy Dunlap
2007-03-22 15:56   ` sparse segfault on ppc64 Dave Jones
2007-03-22 16:02     ` Al Viro
2007-03-22  8:36 ` [PATCH] vector parsing, was " Christopher Li
2007-03-23 23:14   ` [PATCH] vector parsing (take II) Christopher Li

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=Pine.LNX.4.64.0703240957530.6730@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=sam@ravnborg.org \
    --cc=sparse@chrisli.org \
    --cc=viro@ftp.linux.org.uk \
    /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).