Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.lang.c > #392496

Re: "A diagram of C23 basic types"

From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c
Subject Re: "A diagram of C23 basic types"
Date 2025-04-14 02:10 -0700
Organization A noiseless patient Spider
Message-ID <865xj79khz.fsf@linuxsc.com> (permalink)
References (15 earlier) <vsms75$1i8ud$1@dont-email.me> <vsnhq6$291i3$4@dont-email.me> <20250409124900.00000fa1@yahoo.com> <861pu1ccsg.fsf@linuxsc.com> <87a58pq9ig.fsf@nosuchdomain.example.com>

Show all headers | View raw


Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
> [...]
>
>> Trailing commas in argument lists and/or parameter lists
>> could be accepted as an extension, even without giving a
>> diagnostic as I read the C standard, but implementations
>> are certainly within their rights to reject them.
>
> I believe a diagnotic is required.
>
> C17 5.1.1.3:
>
>     A conforming implementation shall produce at least one
>     diagnostic message (identified in an implementation-defined
>     manner) if a preprocessing translation unit or translation
>     unit contains a violation of any syntax rule or constraint,
>     even if the behavior is also explicitly specified as undefined
>     or implementation-defined.
>
> A trailing comma on an argument or parameter list is a violation
> of a syntax rule.

I believe a diagnostic is not required, because the C standard
explicitly allows extensions.  If such diagnostics were required
even for constructions that are part of extensions, then there is no
reason to allow extensions, because whatever behavior is desired
could be done anyway, under the freedom granted by undefined
behavior.  It would be stupid to explicitly grant permission to do
something if it could be done anyway without the permission.  And
the people who wrote the C standard are not stupid.

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


Thread

Re: "A diagram of C23 basic types" Michael S <already5chosen@yahoo.com> - 2025-04-09 12:49 +0300
  Re: "A diagram of C23 basic types" David Brown <david.brown@hesbynett.no> - 2025-04-09 15:01 +0200
    Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-09 12:26 -0500
      Re: "A diagram of C23 basic types" bart <bc@freeuk.com> - 2025-04-09 20:11 +0100
        Re: "A diagram of C23 basic types" David Brown <david.brown@hesbynett.no> - 2025-04-10 09:53 +0200
          Re: "A diagram of C23 basic types" Michael S <already5chosen@yahoo.com> - 2025-04-10 11:37 +0300
            Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-12 05:43 +0000
              Re: "A diagram of C23 basic types" James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-04-12 10:10 -0400
              Re: "A diagram of C23 basic types" David Brown <david.brown@hesbynett.no> - 2025-04-12 17:21 +0200
                Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-12 14:27 -0500
          Re: "A diagram of C23 basic types" Muttley@DastardlyHQ.org - 2025-04-10 10:07 +0000
            Re: "A diagram of C23 basic types" bart <bc@freeuk.com> - 2025-04-10 12:08 +0100
              Re: "A diagram of C23 basic types" Muttley@DastardlyHQ.org - 2025-04-10 12:48 +0000
              Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-12 05:44 +0000
          Re: "A diagram of C23 basic types" bart <bc@freeuk.com> - 2025-04-10 12:42 +0100
            Re: "A diagram of C23 basic types" David Brown <david.brown@hesbynett.no> - 2025-04-10 15:06 +0200
              Re: "A diagram of C23 basic types" bart <bc@freeuk.com> - 2025-04-10 15:29 +0100
                Re: "A diagram of C23 basic types" David Brown <david.brown@hesbynett.no> - 2025-04-10 16:55 +0200
                C implementation headers [was Re: "A diagram of C23 basic types"] scott@slp53.sl.home (Scott Lurndal) - 2025-04-10 15:17 +0000
          Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-10 13:47 -0500
    Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-09 14:56 -0700
      Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-12 05:42 +0000
        Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-12 13:46 -0700
  Re: "A diagram of C23 basic types" Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-04-09 13:14 -0700
    Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-09 15:01 -0700
      Re: "A diagram of C23 basic types" Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-04-14 02:10 -0700
        Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-14 04:08 -0700
    Re: "A diagram of C23 basic types" Michael S <already5chosen@yahoo.com> - 2025-04-10 11:42 +0300
      Re: "A diagram of C23 basic types" Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-04-14 01:59 -0700
        Re: "A diagram of C23 basic types" Michael S <already5chosen@yahoo.com> - 2025-04-14 12:44 +0300
  Re: "A diagram of C23 basic types" Kaz Kylheku <643-408-1753@kylheku.com> - 2025-04-09 20:38 +0000

csiph-web