Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #382712

Re: strong types in c - (safety samples)

From Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups comp.lang.c
Subject Re: strong types in c - (safety samples)
Date 2024-02-18 14:25 -0800
Organization None to speak of
Message-ID <87cyst76lw.fsf@nosuchdomain.example.com> (permalink)
References <uqb741$13gk8$1@dont-email.me> <uqb80h$13jjj$1@dont-email.me> <uqtceu$1bc6c$1@dont-email.me>

Show all headers | View raw


Thiago Adams <thiago.adams@gmail.com> writes:
[...]
> In MISRA the concept is called "essential type"
>
> a == b
>
> The essential type of this expression is boolean.

I don't have access to the MISRA guidelines (they're not free),
but if that's what they say, it sounds like they're badly written.

(It's available for £15.00 from misra.org.uk.  I'm almost, but not
quite, tempted to buy a copy.)

There's no C type called "boolean" unless you define it yourself.
The "essential type" they call "boolean" obviously isn't bool or
_Bool.  It's not even a type in the C sense.  And other posts here
have suggested that MISRA never actually defines what "essential
type" means.

Do the guidelines use the term "essential type" for "types" other
than "boolean"?

It just seems that the authors failed to think of the word
"condition", which would be a much clearer and more precise
description of what I presume they're trying to say.  For example,
they could have written than any expression used as a condition
shall not be an assignment and shall not have an assignment as
any of its subexpressions, and anyone familiar with C would know
exactly what they mean.  (The C standard doesn't define "condition",
but it would be easy to enumerate the contexts in which expressions
are treated as conditions, i.e., where a decision is made based on
whether the expression compares unequal to zero.)

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-11 16:27 -0300
  Re: strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-11 16:43 -0300
    Re: strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-18 13:49 -0300
      Re: strong types in c - (safety samples) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-18 14:25 -0800
        Re: strong types in c - (safety samples) David Brown <david.brown@hesbynett.no> - 2024-02-18 23:40 +0100
          Re: strong types in c - (safety samples) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-18 14:59 -0800
        Re: strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-19 08:34 -0300
          Re: strong types in c - (safety samples) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-02-19 21:16 -0800
            Re: strong types in c - (safety samples) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-19 22:23 -0800
  Re: strong types in c - (safety samples) Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-11 20:37 +0000
    Re: strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-11 18:19 -0300
      Re: strong types in c - (safety samples) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-11 14:08 -0800
    Re: strong types in c - (safety samples) Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-02-13 09:09 +0000
      Re: strong types in c - (safety samples) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-13 14:04 +0000
  Re: strong types in c - (safety samples) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-02-11 20:38 -0800
    Re: strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-12 01:48 -0300
      Re: strong types in c - (safety samples) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-02-16 08:23 -0800
        Re: strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-17 09:28 -0300
  Re: strong types in c - (safety samples) Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-02-13 07:58 +0000
  Re: strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-19 15:21 -0300
    Re: strong types in c - (safety samples) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-19 10:39 -0800
      Re: strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-19 16:03 -0300
        Re: strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-19 16:06 -0300
          Re: strong types in c - (safety samples) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-19 11:31 -0800
          Re: strong types in c - (safety samples) David Brown <david.brown@hesbynett.no> - 2024-02-19 21:36 +0100
            Re: strong types in c - (safety samples) bart <bc@freeuk.com> - 2024-02-19 22:13 +0000
              Re: strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-19 21:59 -0300
                Re: strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-19 22:03 -0300
              Re: strong types in c - (safety samples) Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-20 02:48 +0000
                Re: strong types in c - (safety samples) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-22 13:00 +0100
              Re: strong types in c - (safety samples) David Brown <david.brown@hesbynett.no> - 2024-02-20 09:43 +0100
        Re: strong types in c - (safety samples) Thiago Adams <thiago.adams@gmail.com> - 2024-02-22 14:39 -0300
    Re: strong types in c - (safety samples) David Brown <david.brown@hesbynett.no> - 2024-02-20 09:37 +0100

csiph-web