public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tim Hollebeek <tim@hollebeek.com>
To: Rupert Wood <me@rupey.net>
Cc: "'Zack Weinberg'" <zack@codesourcery.com>,
	"'Jan Hubicka'" <jh@suse.cz>,
	gcc@gcc.gnu.org
Subject: Re: Mined out of comp.std.c...
Date: Thu, 25 Apr 2002 02:06:00 -0000	[thread overview]
Message-ID: <20020425050208.A27283@pcp736370pcs.reston01.va.comcast.net> (raw)
In-Reply-To: <616BE6A276E3714788D2AC35C40CD18D561668@whale.softwire.co.uk>

On Thu, Apr 25, 2002 at 09:38:58AM +0100, Rupert Wood wrote:
> Zack Weinberg wrote:
> 
> > static int int_max (int a, int b) {
> >     int d = (b - a);
> >     return (b - d) & (d >> (CHAR_BIT*sizeof(int) - 1));
> > }
> 
> Maybe I need more coffee, but isn't (b-d) == a?

Consider overflow.

-Tim

  reply	other threads:[~2002-04-25  8:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <616BE6A276E3714788D2AC35C40CD18D5DD6EF@whale.softwire.co.uk>
2002-04-25  1:46 ` Rupert Wood
2002-04-25  2:06   ` Tim Hollebeek [this message]
     [not found] <616BE6A276E3714788D2AC35C40CD18D5DD739@whale.softwire.co.uk>
2002-04-25  3:16 ` Rupert Wood
2002-04-25 11:04   ` Peter Barada
     [not found] <616BE6A276E3714788D2AC35C40CD18D5DD723@whale.softwire.co.uk>
2002-04-25  2:56 ` Rupert Wood
     [not found] <616BE6A276E3714788D2AC35C40CD18D5DD71B@whale.softwire.co.uk>
2002-04-25  2:12 ` Rupert Wood
     [not found] <616BE6A276E3714788D2AC35C40CD18D5DD717@whale.softwire.co.uk>
2002-04-25  1:59 ` Rupert Wood
2002-04-25  0:08 Zack Weinberg
2002-04-25  0:41 ` Alan Modra
2002-04-25  1:12 ` Richard Henderson
2002-04-25  1:53   ` Nathan Sidwell

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=20020425050208.A27283@pcp736370pcs.reston01.va.comcast.net \
    --to=tim@hollebeek.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jh@suse.cz \
    --cc=me@rupey.net \
    --cc=zack@codesourcery.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).