From: jnc@mercury.lcs.mit.edu (Noel Chiappa)
To: tuhs@tuhs.org
Cc: jnc@mercury.lcs.mit.edu
Subject: Re: [TUHS] Archaic yacc C grammar
Date: Wed, 31 Oct 2018 11:39:37 -0400 (EDT) [thread overview]
Message-ID: <20181031153937.767D318C0BF@mercury.lcs.mit.edu> (raw)
> From: Steve Johnson
> references that were checked using the pointer type of the structure
> pointer. My code was a nightmare, and some of the old Unix code was at
> least a bad dream.
I had a 'fun' experience with this when I went to do the pipe splice() system
call (after the discussion here). I elected to do it in V6, which I i) had
running, and ii) know like the back of my hand.
Alas! V6 uses 'int *' everywhere for pointers to structures. It also, in the
pipe code, uses constructs like '(p+1)' to provide wait channels. When I wrote
the new code, I naturally declared my pointers as 'struct inode *ip', or
whatever. However, when I went to do 'sleep(ip+1)', the wrong thing happened!
And since V6 C didn't have coercions, I couldn't win that way. IIRC, I finally
resorted to declaring an 'int *xip', and doing an 'xip = ip' before finally
doing my 'sleep(xip+1)'. Gack!
Noel
next reply other threads:[~2018-10-31 16:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-31 15:39 Noel Chiappa [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-10-28 21:34 Lars Brinkhoff
2018-10-29 3:00 ` Steve Johnson
2018-10-29 7:31 ` Lars Brinkhoff
2018-10-29 17:52 ` Steve Johnson
2018-10-29 18:37 ` Warner Losh
2018-10-30 8:16 ` Lars Brinkhoff
2018-11-03 21:50 ` Steve Johnson
2018-10-29 19:02 ` David
2018-10-30 22:01 ` Steve Johnson
2018-10-31 0:58 ` Larry McVoy
2018-10-31 13:49 ` Clem Cole
2018-11-03 22:14 ` Steve Johnson
2018-10-31 6:09 ` 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=20181031153937.767D318C0BF@mercury.lcs.mit.edu \
--to=jnc@mercury.lcs.mit.edu \
--cc=tuhs@tuhs.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).