linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Given <dg@cowlark.com>
To: linux-sparse@vger.kernel.org
Subject: Re: [RFC] potential DR in handling of signed int and unholy mess in	our and gcc implementations
Date: Thu, 19 Mar 2009 02:33:00 +0000	[thread overview]
Message-ID: <49C1AEDC.9030809@cowlark.com> (raw)
In-Reply-To: <20090319013358.GZ28946@ZenIV.linux.org.uk>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Al Viro wrote:
[...]
> I'll probably go for gcc-like behaviour in sparse for now, unless somebody
> sees a good reason not to.  At least that one is consistent and doesn't
> bring the shitloads of fun questions about behaviour of arithmetic conversions,
> etc.
> 
> Comments?

All I can really say to that is: ew.

I like bitfields and use them frequently, particularly for flags and
packing several small fields into a small space; luckily I've already
been pretty anally retentive about declaring them explicitly as 'signed'
or 'unsigned'.

- From the compiler perspective, Principle of Least Surprise would suggest
doing the consistent thing, which as you say is gcc-like. OTOH from the
linter perspective I'd be *strongly* in favour of a warning if sparse
sees a problematic declaration. Bitfields are an area where signedness
suddenly becomes really important. (int i : 1, anyone?)

Are you submitting a bug report to the standards people?

- --
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ "All power corrupts, but we need electricity." --- Diana Wynne Jones,
│ _Archer's Goon_
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJwa7Zf9E0noFvlzgRAl6ZAKCb1Y9FNTkZRDQqvYH2URVZ7uw4uQCfeN8P
0Tif41kFR7FmUshV5PI7ogA=
=QHru
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-03-19  2:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19  1:33 [RFC] potential DR in handling of signed int and unholy mess in our and gcc implementations Al Viro
2009-03-19  2:33 ` David Given [this message]
2009-03-19 12:10 ` Derek M Jones

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=49C1AEDC.9030809@cowlark.com \
    --to=dg@cowlark.com \
    --cc=linux-sparse@vger.kernel.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).