9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Comeau At9Fans <comeauat9fans@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] integer width on AMD64
Date: Sun,  6 May 2012 09:57:21 -0400	[thread overview]
Message-ID: <CAE9W7-j8hD+9HNXSvr+yL7M9aYtzZDfVfk4mWGap1t6D5MbR9w@mail.gmail.com> (raw)
In-Reply-To: <9655ac7cb9ecbae44a0a0f3ed3b35361@kw.quanstro.net>

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

On Sun, May 6, 2012 at 9:10 AM, erik quanstrom <quanstro@quanstro.net>wrote:

> > Yes, the u{...}int names are important.  Those "different names" are
> > normally for other (though obviously related) purposes (conceptually
> > int_exact_*), and the int_least_* and int_fast_* names, usually are built
>
> the int_least_* names appear to me to be completely wasted, given
> this is how the normal types are defined and that you couldn't depend
> on the extra bits.


Kind of.  The thing is there is the minimums required by the standard and
then there is the minimums provided by the implementation, the latter of
which at least has to match the former.   But yes, the least names can be
viewed to just thrown a wrench into it all.


>  also, how do you debug code written like this?
>

Not easily especially when you begin to look at its interaction with I/O as
well.


> one complete test for each possible definition of int_least_*?
> of course, that leads to the question, is that set known?
>
> one also wonders about int_fast_* as well.  fast /for what/ exactly?
>

IIRC the Standard even specifically leaves that question open.  I think the
goal was to try to codify/match some existing practice at the time
realizing that it wasn't perfect but at least gave a fight chance in some
situation and in those it couldn't, there was probably going to be bumps in
the road either way.  I know it can lead to a why bother situation then.


> it seems that all this is in respose to the fact that the c-std version
> of u32int is not required.


IIRC the full set is not required but I think say uint32_t is.  But it's
been so long you might just be right.


>  (the names are somewhat offensive to
> good taste, so i refer to them as one does carlin's list, by suggestion.)
> rather than fix that issue, layering on another set of types was the
> solution.  really?
>

IIRC the naming was raised a number of times.


>
> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n868.htm :
>
> “       It can also be argued that programmers that use the 'intN_t' more
> than
>        likely really meant to use the 'int_leastN_t' types.  Such
> programmers
>        probably want a type with a guaranteed number of bits rather than an
>        exact number of bits.
>
>        It can be argued further that use of the 'intN_t' names is not
> portable
>        because they may not exist in all implementations.  (An
> implementation
>        is not required to provide these types.)
>
> unfortunately, there are still programmers who use the definition
> more complicated ≡ more better.  evidently believing in the
> transitive nature of "more" over false premises.


Personally I could never buy the whole argument for all those names and
such, and probably would be happy with just the exact ones.  I'm trying to
recall the exact etymology of it but it's too long ago to recall.

-- 
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE ==>     http://www.comeaucomputing.com/tryitout
World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?

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

  reply	other threads:[~2012-05-06 13:57 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAL3m8eAf2Yjpg77wtykTSPnyKHxKHYc5YWfWH2L8CNjc86P1kA@mail.gmail.c>
2012-04-25 14:28 ` [9fans] AMD64 system erik quanstrom
2012-04-25 18:04   ` Strake
2012-04-25 18:27     ` Lyndon Nerenberg
2012-04-25 18:49       ` Matthew Veety
2012-04-25 19:09         ` Strake
2012-04-25 19:15           ` John Floren
2012-04-25 19:57             ` Strake
2012-04-25 20:04               ` John Floren
2012-04-25 20:30                 ` Strake
2012-04-25 20:43                   ` John Floren
2012-04-26  1:11                     ` Strake
2012-04-26  1:21                       ` andrey mirtchovski
2012-04-26  1:24                         ` andy zerger
2012-04-26  1:49                       ` John Floren
2012-04-26  3:41                         ` Strake
2012-04-25 19:19           ` Lyndon Nerenberg
2012-04-25 20:01             ` Strake
2012-04-25 20:05               ` Gorka Guardiola
2012-04-25 20:08               ` Lyndon Nerenberg
     [not found]         ` <CAL3m8eCJughpHZ6htHyLyq9vORA+z5ajpWMbWjnCTVZ+YZRv9g@mail.gmail.c>
2012-04-25 19:36           ` erik quanstrom
     [not found]       ` <CA+4OWrwGgkYfuj2t4dkWsZHFex4oFTveDq_9A+yr=TsNpG0C8g@mail.gmail.c>
2012-04-25 18:56         ` erik quanstrom
2012-04-25 19:16           ` Strake
     [not found]           ` <CAL3m8eDJEo6o+srxuYpKSGDmM+0KgQhC15u7Qxg4TvnpO57Zgw@mail.gmail.c>
2012-04-25 19:32             ` erik quanstrom
2012-04-25 20:13               ` Strake
2012-04-25 20:20                 ` Lyndon Nerenberg
2012-04-26  3:38                 ` Russ Cox
2012-04-26  4:04                   ` Devon H. O'Dell
2012-04-26  4:13                     ` andrey mirtchovski
2012-04-26  4:36                   ` Strake
2012-05-05 15:02                   ` Ethan Grammatikidis
2012-05-05 15:33               ` [9fans] integer width on AMD64 (was: Re: AMD64 system) dexen deVries
2012-05-05 16:41                 ` David du Colombier
2012-05-05 17:42                 ` erik quanstrom
2012-05-05 17:48                 ` Charles Forsyth
2012-05-05 17:52                   ` dexen deVries
2012-05-05 21:06                   ` Comeau At9Fans
2012-05-06  2:58                     ` [9fans] integer width on AMD64 Joel C. Salomon
2012-05-06  3:13                       ` Bruce Ellis
2012-05-06  8:46                       ` Comeau At9Fans
     [not found]                       ` <CAE9W7-gmaSYzx+4TK0LKtiHaZYC-4xz_DTbC_wqhsGo_7zXc0Q@mail.gmail.c>
2012-05-06 13:10                         ` erik quanstrom
2012-05-06 13:57                           ` Comeau At9Fans [this message]
2012-05-06  9:20                   ` [9fans] integer width on AMD64 (was: Re: AMD64 system) steve
2012-05-06 11:43                     ` Comeau At9Fans
2012-05-07  8:53                       ` steve
2012-05-07 10:01                         ` dexen deVries
2012-05-07 10:16                           ` Charles Forsyth
2012-05-07 10:27                           ` Charles Forsyth
2012-05-07 10:36                             ` dexen deVries
2012-05-08 19:04                               ` Comeau At9Fans
     [not found]                           ` <CAOw7k5h9QVUCrKr4jYU++sSWE6DHqbA_oFRwajyKbj7A0AjBWg@mail.gmail.c>
2012-05-07 12:11                             ` erik quanstrom
2012-05-07 12:32                           ` erik quanstrom
2012-05-07 12:44                         ` erik quanstrom
2012-05-08 19:14                           ` Comeau At9Fans
2012-05-05 21:00                 ` Comeau At9Fans
     [not found]   ` <CAL3m8eDMXC2STjFjBUurmdY5DynCOrpqwE-ViRuSubfF6HjBOw@mail.gmail.c>
2012-04-25 18:11     ` [9fans] AMD64 system erik quanstrom

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=CAE9W7-j8hD+9HNXSvr+yL7M9aYtzZDfVfk4mWGap1t6D5MbR9w@mail.gmail.com \
    --to=comeauat9fans@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).