Re: "A diagram of C23 basic types"

Liste des GroupesRevenir à cl c  
Sujet : Re: "A diagram of C23 basic types"
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c
Date : 02. Apr 2025, 15:59:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vsjjd1$23ukt$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 02/04/2025 16:05, Muttley@DastardlyHQ.org wrote:
On Wed, 2 Apr 2025 15:35:31 +0200
David Brown <david.brown@hesbynett.no> wibbled:
On 02/04/2025 12:14, Muttley@DastardlyHQ.org wrote:
On Wed, 2 Apr 2025 10:57:29 +0100
bart <bc@freeuk.com> wibbled:
On 02/04/2025 06:59, Alexis wrote:
>
Thought people here might be interested in this image on Jens Gustedt's
blog, which translates section 6.2.5, "Types", of the C23 standard
into a graph of inclusions:
>
     https://gustedt.wordpress.com/2025/03/29/a-diagram-of-c23-basic-types/
>
>
So much for C being a 'simple' language.
>
C should be left alone. It does what it needs to do for a systems language.
Almost no use uses it for applications any more and sophisticated processing
using complex types for example are far better done in C++.
>
IMO, YMMV.
>
>
The C standards committee knows what C is used for.  You can be quite
confident that they have heard plenty of people say that "C should be
left alone", as well as other people say "We would like feature X to be
standardised in C".
 I suspect the people who are happy with C never have any correspondence with
anyone from the committee so they get an entirely biased sample. Just like
its usually only people who had a bad experience that fill in "How did we do"
surveys.
And I suspect that you haven't a clue who the C standards committee talk to - and who those people in turn have asked.
Of course there are plenty of people who just use whatever the compiler and library provide, without complaint or feedback of any kind, without thinking about standards, much less reading about them.  And everyone involved - the library developers, the compiler developers, the standards committee - /knows/ this.  Everyone involved /knows/ that compilers and libraries, the C implementations, will continue to support the existing standards and won't break old, working code because of new keywords or features.

 
Changes and new features are not added to the C standards just for fun,
or just to annoy people - they are there because some people want them
and expect that they can write better / faster / clearer / safer /
easier code as a result.
 And add complexity to compilers.
>
Yes.  But that's okay - it has always been acceptable to make compiler writers do more work if it is better for compiler users.

So what exactly is better / faster / clearer / safer in C23?
 
Have a little look at Annex M of the standard and you can see the list of changes:
<https://open-std.org/JTC1/SC22/WG14/www/docs/n3467.pdf>
The things I expect to use from C23 in my own work include:
1. I will gradually move over to standard attributes instead of gcc attributes where practical.  That will make code more portable.  (The attributes themselves improve static error checking and code efficiency, but that will be much the same in "-std=c23" compared to "-std=gnu17".)
2. Single-argument "static_assert", without needing macros - static assertions make code safer and sometimes more efficient, and the single-argument version makes it neater and clearer.
3. /Finally/ the old-style function declarations are dead.  "int foo();" now means what many programmers think it means, for greater safety and convenience.  Identifiers can be omitted in function definitions if they are not used, which is clearer and neater than alternatives.
4. I expect to use a few of the new library functions, such as memccpy, as safer and/or more efficient than alternatives.
5. "constexpr" for safety, efficiency and convenience.
6. "static" compound literals.
7. "typeof" and "auto" for type inference is standardised, so I don't need to use the gcc extensions for them.  These can make code safer and clearer (though their benefits are much smaller in C than C++).
8. I probably won't use _BitInt(N) types directly - their primary use will be for hardware implementation of C code in FPGAs.
9. Slightly better and safer enumeration types.
10. Bit-manipulation functions for greater portability and possibly greater efficiency.
11. nullptr for clarity and safety.
12. Some improvements to variadic macros.
13. Changes to the way "intmax_t" is defined might mean access to int128_t and uint128_t on more platforms.
14. #elifdef and #elifndef can make complicated conditional compilation a little neater.
15. #warning is now standard.
16. Binary literals are now standard.
17. Digit separators make large numbers clearer.
18. "unreachable()" is now standard.
19. printf (and friends) support for things like "%w32i" as the format specifier for int32_t, so that we no longer need the ugly PRIi32 style of macro for portable code with fixed-size types.
 From the next version beyond C23, so far there is :
1. Declarations in "if" and "switch" statements, like those in "for" loops, helps keep local variable scopes small and neat.
2. Ranges in case labels - that speaks for itself (though again I used it already as a gcc extension).
3. Hopefully the 0o and 0O octal prefixes will mean that the 0 octal prefix will be deprecated and warned about by compilers (other than for plain 0, obviously).
None of this are a big deal, and many are already things I use in my code (since I can use gcc extensions), but there are enough small benefits that I will move over to C23 on new projects.

Date Sujet#  Auteur
2 Apr 25 * "A diagram of C23 basic types"296Alexis
2 Apr 25 +* Re: "A diagram of C23 basic types"4Lawrence D'Oliveiro
3 Apr 25 i`* Re: "A diagram of C23 basic types"3BGB
3 Apr 25 i `* Re: "A diagram of C23 basic types"2Lawrence D'Oliveiro
4 Apr 25 i  `- Re: "A diagram of C23 basic types"1BGB
2 Apr 25 +* Re: "A diagram of C23 basic types"9Janis Papanagnou
2 Apr 25 i+* Re: "A diagram of C23 basic types"6Kaz Kylheku
3 Apr 25 ii`* Re: "A diagram of C23 basic types"5Janis Papanagnou
3 Apr 25 ii +* Re: "A diagram of C23 basic types"3David Brown
3 Apr 25 ii i`* Re: "A diagram of C23 basic types"2Janis Papanagnou
3 Apr 25 ii i `- Re: "A diagram of C23 basic types"1BGB
3 Apr 25 ii `- Re: "A diagram of C23 basic types"1BGB
2 Apr 25 i+- Re: "A diagram of C23 basic types"1David Brown
3 Apr 25 i`- Re: "A diagram of C23 basic types"1Tim Rentsch
2 Apr 25 +* Re: "A diagram of C23 basic types"276bart
2 Apr 25 i+* Re: "A diagram of C23 basic types"250Muttley
2 Apr 25 ii+* Re: "A diagram of C23 basic types"220David Brown
2 Apr 25 iii+* Re: "A diagram of C23 basic types"216Muttley
2 Apr 25 iiii+* Re: "A diagram of C23 basic types"142Thiago Adams
2 Apr 25 iiiii`* Re: "A diagram of C23 basic types"141Muttley
2 Apr 25 iiiii +* Re: "A diagram of C23 basic types"139bart
2 Apr 25 iiiii i+* Re: "A diagram of C23 basic types"58Muttley
2 Apr 25 iiiii ii+* Re: "A diagram of C23 basic types"5Janis Papanagnou
3 Apr 25 iiiii iii+* Re: "A diagram of C23 basic types"2Janis Papanagnou
3 Apr 25 iiiii iiii`- Re: "A diagram of C23 basic types"1Janis Papanagnou
3 Apr 25 iiiii iii`* Re: "A diagram of C23 basic types"2David Brown
3 Apr 25 iiiii iii `- Re: "A diagram of C23 basic types"1BGB
3 Apr 25 iiiii ii+* Re: "A diagram of C23 basic types"49bart
3 Apr 25 iiiii iii+* Re: "A diagram of C23 basic types"46Kaz Kylheku
3 Apr 25 iiiii iiii+* Re: "A diagram of C23 basic types"43Keith Thompson
3 Apr 25 iiiii iiiii+* Re: "A diagram of C23 basic types"41BGB
3 Apr 25 iiiii iiiiii`* Re: "A diagram of C23 basic types"40Kaz Kylheku
3 Apr 25 iiiii iiiiii +* Re: "A diagram of C23 basic types"36bart
4 Apr 25 iiiii iiiiii i+* Re: "A diagram of C23 basic types"31Lawrence D'Oliveiro
9 Apr 25 iiiii iiiiii ii`* Re: "A diagram of C23 basic types"30Michael S
9 Apr 25 iiiii iiiiii ii +* Re: "A diagram of C23 basic types"21David Brown
9 Apr 25 iiiii iiiiii ii i+* Re: "A diagram of C23 basic types"17BGB
9 Apr 25 iiiii iiiiii ii ii`* Re: "A diagram of C23 basic types"16bart
10 Apr 25 iiiii iiiiii ii ii `* Re: "A diagram of C23 basic types"15David Brown
10 Apr 25 iiiii iiiiii ii ii  +* Re: "A diagram of C23 basic types"5Michael S
12 Apr06:43 iiiii iiiiii ii ii  i`* Re: "A diagram of C23 basic types"4Lawrence D'Oliveiro
12 Apr15:10 iiiii iiiiii ii ii  i +- Re: "A diagram of C23 basic types"1James Kuyper
12 Apr16:21 iiiii iiiiii ii ii  i `* Re: "A diagram of C23 basic types"2David Brown
12 Apr20:27 iiiii iiiiii ii ii  i  `- Re: "A diagram of C23 basic types"1BGB
10 Apr 25 iiiii iiiiii ii ii  +* Re: "A diagram of C23 basic types"4Muttley
10 Apr 25 iiiii iiiiii ii ii  i`* Re: "A diagram of C23 basic types"3bart
10 Apr 25 iiiii iiiiii ii ii  i +- Re: "A diagram of C23 basic types"1Muttley
12 Apr06:44 iiiii iiiiii ii ii  i `- Re: "A diagram of C23 basic types"1Lawrence D'Oliveiro
10 Apr 25 iiiii iiiiii ii ii  +* Re: "A diagram of C23 basic types"4bart
10 Apr 25 iiiii iiiiii ii ii  i`* Re: "A diagram of C23 basic types"3David Brown
10 Apr 25 iiiii iiiiii ii ii  i `* Re: "A diagram of C23 basic types"2bart
10 Apr 25 iiiii iiiiii ii ii  i  `- Re: "A diagram of C23 basic types"1David Brown
10 Apr 25 iiiii iiiiii ii ii  `- Re: "A diagram of C23 basic types"1BGB
9 Apr 25 iiiii iiiiii ii i`* Re: "A diagram of C23 basic types"3Keith Thompson
12 Apr06:42 iiiii iiiiii ii i `* Re: "A diagram of C23 basic types"2Lawrence D'Oliveiro
12 Apr21:46 iiiii iiiiii ii i  `- Re: "A diagram of C23 basic types"1Keith Thompson
9 Apr 25 iiiii iiiiii ii +* Re: "A diagram of C23 basic types"7Tim Rentsch
9 Apr 25 iiiii iiiiii ii i+* Re: "A diagram of C23 basic types"3Keith Thompson
14 Apr10:10 iiiii iiiiii ii ii`* Re: "A diagram of C23 basic types"2Tim Rentsch
14 Apr12:08 iiiii iiiiii ii ii `- Re: "A diagram of C23 basic types"1Keith Thompson
10 Apr 25 iiiii iiiiii ii i`* Re: "A diagram of C23 basic types"3Michael S
14 Apr09:59 iiiii iiiiii ii i `* Re: "A diagram of C23 basic types"2Tim Rentsch
14 Apr10:44 iiiii iiiiii ii i  `- Re: "A diagram of C23 basic types"1Michael S
9 Apr 25 iiiii iiiiii ii `- Re: "A diagram of C23 basic types"1Kaz Kylheku
4 Apr 25 iiiii iiiiii i`* Re: "A diagram of C23 basic types"4Waldek Hebisch
4 Apr 25 iiiii iiiiii i +* Re: "A diagram of C23 basic types"2Keith Thompson
4 Apr 25 iiiii iiiiii i i`- Re: "A diagram of C23 basic types"1Waldek Hebisch
8 Apr 25 iiiii iiiiii i `- Re: "A diagram of C23 basic types"1Lawrence D'Oliveiro
3 Apr 25 iiiii iiiiii +* Re: "A diagram of C23 basic types"2Keith Thompson
4 Apr 25 iiiii iiiiii i`- Re: "A diagram of C23 basic types"1Kaz Kylheku
4 Apr 25 iiiii iiiiii `- Re: "A diagram of C23 basic types"1Michael S
4 Apr 25 iiiii iiiii`- Re: "A diagram of C23 basic types"1Lawrence D'Oliveiro
3 Apr 25 iiiii iiii+- Re: "A diagram of C23 basic types"1Muttley
3 Apr 25 iiiii iiii`- Re: "A diagram of C23 basic types"1Keith Thompson
3 Apr 25 iiiii iii+- Re: "A diagram of C23 basic types"1David Brown
4 Apr 25 iiiii iii`- Re: "A diagram of C23 basic types"1Lawrence D'Oliveiro
3 Apr 25 iiiii ii`* Re: "A diagram of C23 basic types"3Muttley
4 Apr 25 iiiii ii `* Re: "A diagram of C23 basic types"2Muttley
4 Apr 25 iiiii ii  `- Re: "A diagram of C23 basic types"1Muttley
4 Apr 25 iiiii i`* Re: "A diagram of C23 basic types"80Lawrence D'Oliveiro
4 Apr 25 iiiii i +- Re: "A diagram of C23 basic types"1Keith Thompson
7 Apr 25 iiiii i +* Re: "A diagram of C23 basic types"29candycanearter07
7 Apr 25 iiiii i i+* Re: "A diagram of C23 basic types"27Janis Papanagnou
8 Apr 25 iiiii i ii+- Re: "A diagram of C23 basic types"1candycanearter07
14 Apr05:33 iiiii i ii`* Re: "A diagram of C23 basic types"25Lawrence D'Oliveiro
14 Apr18:40 iiiii i ii `* Re: "A diagram of C23 basic types"24candycanearter07
14 Apr18:46 iiiii i ii  +* Re: "A diagram of C23 basic types"2Kaz Kylheku
15 Apr08:41 iiiii i ii  i`- Re: "A diagram of C23 basic types"1Janis Papanagnou
14 Apr19:36 iiiii i ii  `* Re: "A diagram of C23 basic types"21BGB
14 Apr23:15 iiiii i ii   +- Re: "A diagram of C23 basic types"1Keith Thompson
14 Apr23:33 iiiii i ii   `* Re: "A diagram of C23 basic types"19Lawrence D'Oliveiro
14 Apr23:56 iiiii i ii    +* Re: "A diagram of C23 basic types"12Keith Thompson
15 Apr00:41 iiiii i ii    i+* Re: "A diagram of C23 basic types"7Lawrence D'Oliveiro
15 Apr01:57 iiiii i ii    ii+- Re: "A diagram of C23 basic types"1Keith Thompson
15 Apr04:25 iiiii i ii    ii`* Re: "A diagram of C23 basic types"5James Kuyper
15 Apr05:11 iiiii i ii    ii +* Re: "A diagram of C23 basic types"2Lawrence D'Oliveiro
15 Apr15:06 iiiii i ii    ii i`- Re: "A diagram of C23 basic types"1James Kuyper
15 Apr06:00 iiiii i ii    ii `* Re: "A diagram of C23 basic types"2BGB
15 Apr18:29 iiiii i ii    ii  `- Re: "A diagram of C23 basic types"1BGB
15 Apr02:46 iiiii i ii    i`* Re: "A diagram of C23 basic types"4Chris M. Thomasson
15 Apr05:14 iiiii i ii    i +- Re: "A diagram of C23 basic types"1Lawrence D'Oliveiro
15 Apr15:19 iiiii i ii    i `* Re: "A diagram of C23 basic types"2James Kuyper
15 Apr01:43 iiiii i ii    `* Re: "A diagram of C23 basic types"6BGB
8 Apr 25 iiiii i i`- Re: "A diagram of C23 basic types"1Lawrence D'Oliveiro
7 Apr 25 iiiii i `* Re: "A diagram of C23 basic types"49bart
4 Apr 25 iiiii `- Re: "A diagram of C23 basic types"1Lawrence D'Oliveiro
2 Apr 25 iiii+* Re: "A diagram of C23 basic types"2Michael S
2 Apr 25 iiii`* Re: "A diagram of C23 basic types"71David Brown
2 Apr 25 iii`* Re: "A diagram of C23 basic types"3Kaz Kylheku
2 Apr 25 ii`* Re: "A diagram of C23 basic types"29Waldek Hebisch
5 Apr 25 i`* Re: "A diagram of C23 basic types"25Philipp Klaus Krause
3 Apr 25 +* Re: "A diagram of C23 basic types"2Michael S
11 Apr17:34 +* Re: "A diagram of C23 basic types"2Tim Rentsch
11 Apr17:48 `* Re: "A diagram of C23 basic types"2Tim Rentsch

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal