All of lore.kernel.org
 help / color / mirror / Atom feed
From: Derek M Jones <derek@knosof.co.uk>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [RFC] explicitly signed and friends
Date: Tue, 03 Jul 2007 16:38:49 +0100	[thread overview]
Message-ID: <468A6D89.3050800@knosof.co.uk> (raw)
In-Reply-To: <20070702203008.GH21478@ftp.linux.org.uk>

Al,

> 4)
> gcc is kinda-sorta tolerant to mixing pointers to signed and unsigned,
> unless you explicitly ask to be strict.  However, it's nowhere near
> as lenient as sparse.

Values wrapping because of signed/unsigned is a common cause of
faults.  In those contexts where the pointer is eventually dereferenced
to obtain a pointer I think sparse should continue to complain.

Differences of sign in pointer subtraction may or may not be regarded as
harmless.

I appreciate that gcc is currently an important compiler.  But I
know of several compiler groups who would like to be able to build
an executable kernel using their compiler.  Having sparse complain about
constructs that gcc is rather lax about means that those involved in
kernel development might fix the underlying problem in their code.
Such fixes are good in that they increase the probability that a
different compiler will successfully compile the kernel.  I think a
bit of competition in the kernel compiler market would help keep the
gcc people on their toes.

-- 
Derek M. Jones                              tel: +44 (0) 1252 520 667
Knowledge Software Ltd                      mailto:derek@knosof.co.uk
Applications Standards Conformance Testing    http://www.knosof.co.uk

  reply	other threads:[~2007-07-03 15:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-02 20:30 [RFC] explicitly signed and friends Al Viro
2007-07-03 15:38 ` Derek M Jones [this message]
2007-07-03 23:01   ` Al Viro
2007-07-04  0:51     ` 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=468A6D89.3050800@knosof.co.uk \
    --to=derek@knosof.co.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.