9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <charles.forsyth@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Compiler bug
Date: Fri, 30 May 2014 15:56:33 +0100	[thread overview]
Message-ID: <CAOw7k5gq2CNX7+Pv6VkRc9QC2EioUjsY_JLYcT9AuDBSnbNJeQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1405301457450.6583@localhost>

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]

On 30 May 2014 14:03, Julius Schmidt <aiju@phicode.de> wrote:

> Comparing an int to a u16int causes the int to be cast to unsigned int,
> instead of the u16int being promoted to int and then compared (as I would
> argue the C89 standard specifies).


Ken's compiler implements the original unsigned-preserving rule instead of
ANSI's later invention.
That has the advantage of the type not being dependent on the underlying
storage size,
but as you say the disadvantage of not using the so-called value-preserving
rule.
I suppose if I add some code that detects where it made a difference it
might not cause too
much trouble to change from the simple rule. I imagine p9p has already
found most cases anyway.
Otherwise, it's another more subtler nsec!

[-- Attachment #2: Type: text/html, Size: 1245 bytes --]

  reply	other threads:[~2014-05-30 14:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-30 13:03 Julius Schmidt
2014-05-30 14:56 ` Charles Forsyth [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-07-14  5:39 [9fans] compiler bug David Gordon Hogan
2001-07-14  7:52 ` Mike Haertel
2001-07-12 13:19 forsyth
2001-07-12 10:33 forsyth
2001-07-12  6:27 Mike Haertel
2001-07-12 10:21 ` Boyd Roberts

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=CAOw7k5gq2CNX7+Pv6VkRc9QC2EioUjsY_JLYcT9AuDBSnbNJeQ@mail.gmail.com \
    --to=charles.forsyth@gmail.com \
    --cc=9fans@9fans.net \
    /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).