linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Li <sparse@chrisli.org>
To: Josh Triplett <josh@joshtriplett.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>,
	Al Viro <viro@ftp.linux.org.uk>
Subject: Re: __attribute__((force)) should not be a storage class
Date: Sat, 1 Feb 2014 21:51:11 -0800	[thread overview]
Message-ID: <CANeU7Qm1=8ks=Fu6LzjuAYxRqLPS3gssmD+uxNzDfN568Xxodw@mail.gmail.com> (raw)
In-Reply-To: <20140201184935.GA12321@leaf>

On Sat, Feb 1, 2014 at 10:49 AM, Josh Triplett <josh@joshtriplett.org> wrote:
> Commit 3829c4d8b097776e6b3472290a9fae08a705ab7a ("Don't mix storage
> class bits with ctype->modifiers while parsing type") in 2009 separated
> storage classes from modifiers; in the process, it changed
> __attribute__((force)) from a modifier to a storage class.  I don't
> think it makes sense to have force as a storage class, for one critical
> reason: storage classes are mutually exclusive.

I am not convinced yet.

The current usage case for attribute "force" is to silence the type
mismatch during the type conversion. For variable declaration, there is
not need to silence any mismatch because there is no type conversion.

What you are purposing here is a new usage case. Do you want
to silence every single type mismatch in every assignment to that
variable? How about assignment from that variable?

That seems a lot of complexity to keep track of the attribute
belong to which level of the type tree.

>
> $ cat /tmp/test.c
> static __attribute__((force)) int *p;
> static int q = *p;

In this example, the attribute "force" is not needed.
I think it compiles fine without forcing it. The "force" don't
actually do any thing. So why do we want to support this?

I want to justify the extra complexity it add to the code
base.

Chris

  reply	other threads:[~2014-02-02  5:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-01 18:49 __attribute__((force)) should not be a storage class Josh Triplett
2014-02-02  5:51 ` Christopher Li [this message]
2014-02-02  8:38   ` Josh Triplett
2014-02-27 21:00     ` 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='CANeU7Qm1=8ks=Fu6LzjuAYxRqLPS3gssmD+uxNzDfN568Xxodw@mail.gmail.com' \
    --to=sparse@chrisli.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-sparse@vger.kernel.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).