The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: scj@yaccman.com (Steve Johnson)
Subject: [TUHS] origins of void* -- Apology!
Date: Wed, 08 Nov 2017 17:35:39 -0800	[thread overview]
Message-ID: <e95ae6c51de57b8e7cc232dda68636e48f4a00fd@webmail.yaccman.com> (raw)
In-Reply-To: <CANCZdfpA1HDfvCOfU40Qx+EGdrj_r1OUb+Wgxa_Qcp-9uJekuA@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2323 bytes --]

I don't think either Dennis or I ever thought that characters should
be signed.  It's true that PCC didn't specify it.  It's also true
that in those days the 8th bit in a char was pretty much unused
(except by the shell), so the issue never arose.  I believe the folks
at Bell Labs Holmdel who did the port to the Vax were the first ones
to come up with signed characters.  I think it was a real blot on
C.  For example, consider:
       struct {  ....
              char x:1;
       ...
       }

If characters are signed, the only legal values of x are 0 and -1 (!)

Steve

----- Original Message -----
From:
 "Warner Losh" <imp at bsdimp.com>

To:
"Nemo" <cym224 at gmail.com>
Cc:
"The Eunuchs Hysterical Society" <tuhs at tuhs.org>
Sent:
Wed, 8 Nov 2017 09:12:50 -0700
Subject:
Re: [TUHS] origins of void* -- Apology!

On Wed, Nov 8, 2017 at 9:07 AM, Nemo <cym224 at gmail.com [1]>
 wrote:
On 6 November 2017 at 19:36, Ron Natalie <ron at ronnatalie.com [2]>
wrote:
 > It’s worse than that.   “char” is defined as neither signed
nor unsigned.
 > The signedness is implementation defined.    This was why we have
the inane
 > “signed” keyword.

 What was that story about porting an early UNIX to a machine with
 different char polarity?  I dimly recall only a few problems.

Doesn't even have to be very early... There's lots of 'assume char is
signed bugs' in even modern code. So many that ARM gave up on the idea
that unsigned char was good (since the underlying ARM architecture
supported it better) and their modern ABIs are all signed char. The
other thing that EABI fixes is the crazy alignment rules that were
out-of-step with the rest of the computer industry that broke a lot of
networking and storage code on ARM because its rules caused structs
that would otherwise describe the binary layout to be suddenly wrong.
Yes, that is an implementation choice, just a poor one that was
eventually corrected.

When I was working on FreeBSD/arm only a decade ago, I'd routinely hit
both of these issues...

Warner

 

Links:
------
[1] mailto:cym224 at gmail.com
[2] mailto:ron at ronnatalie.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20171108/c2c13b12/attachment.html>


  parent reply	other threads:[~2017-11-09  1:35 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 16:07 Nemo
2017-11-08 16:12 ` Warner Losh
2017-11-08 19:59   ` Ron Natalie
2017-11-08 23:33   ` Steffen Nurpmeso
2017-11-09  1:35   ` Steve Johnson [this message]
2017-11-08 20:28 ` [TUHS] NUXI Problem Warren Toomey
2017-11-08 20:38   ` Ron Natalie
2017-11-08 20:39   ` Clem Cole
2017-11-08 23:14   ` Warren Toomey
  -- strict thread matches above, loose matches on Subject: below --
2017-11-07 15:34 [TUHS] origins of void* -- Apology! Nelson H. F. Beebe
2017-11-08 12:48 ` Tony Finch
2017-11-08 13:36   ` Otto Moerbeek
2017-11-08 16:03   ` Warner Losh
2017-11-06 15:02 [TUHS] origins of void* Warner Losh
2017-11-06 21:46 ` [TUHS] origins of void* -- Apology! Steve Johnson
2017-11-06 22:18   ` Warner Losh
2017-11-07  0:25   ` Ron Natalie
2017-11-07  0:34     ` Arthur Krewat
2017-11-07  0:36       ` Ron Natalie
2017-11-07  1:09     ` Bakul Shah
2017-11-07  1:55       ` Ron Natalie
2017-11-08 17:44       ` Ralph Corderoy
2017-11-08 19:56         ` Ron Natalie
2017-11-08 20:39           ` Don Hopkins
2017-11-08 20:42             ` Ron Natalie
2017-11-08 20:47               ` Don Hopkins
2017-11-08 20:48                 ` Don Hopkins
2017-11-08 20:43             ` Don Hopkins
2017-11-08 20:43             ` Clem Cole
2017-11-08 20:45             ` Warner Losh
2017-11-09  6:33               ` Lars Brinkhoff
2017-11-08 20:50           ` Steve Nickolas
2017-11-08 21:25         ` Bakul Shah
2017-11-09  6:37           ` Lars Brinkhoff
2017-11-09  7:14             ` Don Hopkins
2017-11-09  7:44               ` Lars Brinkhoff

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=e95ae6c51de57b8e7cc232dda68636e48f4a00fd@webmail.yaccman.com \
    --to=scj@yaccman.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 NNTP newsgroup(s).