The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: scj@yaccman.com (scj@yaccman.com)
Subject: [TUHS] Subject:   changes for modern -> v7 -> v6 -> v5
Date: Mon, 4 Aug 2014 12:11:27 -0700	[thread overview]
Message-ID: <c0f73ff7b2159f33da79275f0f21f109.squirrel@webmail.yaccman.com> (raw)
In-Reply-To: <201408040356.s743u23Y008576@coolidge.cs.dartmouth.edu>


>
> Incidentally, I would say that the use of conditional compilation
> is evidence that the code is NOT truly universal, but has to be
> specially adapted to various environments.
>

For the most part, I agree, but there are some exceptions.  For example,
bit fields in C/C++ are laid out using the byte ordering conventions of
the target machine.  This can make it nearly impossible to write low-level
code to drive, e.g., hardware or communication protocols without
conditional compilation.

Of course, you can always shift and mask.  The code becomes
incomprehensible, but identical for big- and little-endian.  For my money,
using bit fields leads to code that is clear and easy to debug, and the
obvious rationale of the conditional code makes it a winner.

Steve




      reply	other threads:[~2014-08-04 19:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04  3:56 Doug McIlroy
2014-08-04 19:11 ` scj [this message]

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=c0f73ff7b2159f33da79275f0f21f109.squirrel@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).