linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: How to fix: asm output is not an lvalue
Date: Sun, 27 Apr 2014 08:48:04 +0200	[thread overview]
Message-ID: <20140427064803.GA31264@ravnborg.org> (raw)
In-Reply-To: <CA+55aFx0QAPEDBEyb+fDsb+Asb-q_6tb7K=KMLP4o4DxncxSpg@mail.gmail.com>

On Sat, Apr 26, 2014 at 04:44:13PM -0700, Linus Torvalds wrote:
> On Sat, Apr 26, 2014 at 2:57 PM, Sam Ravnborg <sam@ravnborg.org> wrote:
> >
> > Following code snippet generate these warnings:
> > t.c:9:9: warning: asm output is not an lvalue
> 
> Yeah. That code snippet is pure and utter garbage.
> 
> Gcc has this totally insane extension that makes casts be lvalues.
> It's stupid and horrid, and pointless to boot. So apparently gcc
> accepts that crap.
> 
> But it is very much total crap.
> 
> Those casts to (USItype) are all pointless to begin with (since the
> values are of that type already!) and they mean that the expression
> isn't something you can assign to (lvalue). The fact that gcc accepts
> code like that is an embarrassment.

Thanks.
When I dropped the casts to the output values the warnings were gone.

Now the code is down to ~30 warnings - looks like this.
math_32.c:371:17: warning: shift too big (4294967267) for type unsigned long
math_32.c:428:21: warning: shift too big (63) for type unsigned long

But this code is so full of macros that it is not funny :-(

	Sam

  reply	other threads:[~2014-04-27  6:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-26 21:57 How to fix: asm output is not an lvalue Sam Ravnborg
2014-04-26 23:44 ` Linus Torvalds
2014-04-27  6:48   ` Sam Ravnborg [this message]
2014-04-27  6:57     ` Josh Triplett
2014-04-27  8:41       ` Sam Ravnborg

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=20140427064803.GA31264@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=torvalds@linux-foundation.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).