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


Groups > comp.lang.c > #382580

Re: strong types in c - (safety samples)

From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c
Subject Re: strong types in c - (safety samples)
Date 2024-02-16 08:23 -0800
Organization A noiseless patient Spider
Message-ID <86bk8gz8c8.fsf@linuxsc.com> (permalink)
References <uqb741$13gk8$1@dont-email.me> <867cja47qp.fsf@linuxsc.com> <uqc7v6$1c4fp$1@dont-email.me>

Show all headers | View raw


Thiago Adams <thiago.adams@gmail.com> writes:

> Em 2/12/2024 1:38 AM, Tim Rentsch escreveu:
>
>> Thiago Adams <thiago.adams@gmail.com> writes:
>>
>>> Consider:
>>>
>>> void f(int i);
>>>
>>> enum E {A};
>>>
>>> int main(){
>>>      f(A); //cake will have a warning here
>>> }
>>>
>>>
>>> I will create a diagnostic in cake for this and others.
>>> Basically I will respect the standard where it says enumerators are
>>> int, but I will create a strict mode where this and other types of
>>> conversion happens.
>>>
>>>
>>> int main(){
>>>      f(true); //cake will have a warning here
>>>      f('A'); //not sure this one..
>>> }
>>>
>>> the same for enums.
>>
>> This is comp.lang.c.  Please take any discussions of languages
>> other than C to a venue where those discussions are topical,
>> such as comp.lang.misc.
>
> Not sure what you mean.
> This is about C and diagnostics.
>
> For instance:
>
> void f(int i);
> int main()
> {
>   f(true);
> }
>
> If a compiler emit a diagnostic "warning passing _Bool to integer" do
> you think this is not C any more?

The language you're talking about may have the same syntax
as C, but it has different semantic rules, and that is the
point of your discussion.  What you're talking about is not
about C.  I know you like to pretend that it's the same,
but it isn't.

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