Liste des Groupes | Revenir à cl c |
On 09/01/2025 16:28, bart wrote:OK, I start getting the picture: indeed, let it be C99... Thanks very much for that, to you in particular but also to those who have chimed in, greatly appreciated.On 09/01/2025 14:11, David Brown wrote:Opinions on clarity vary - I was giving /my/ opinion.On 09/01/2025 09:07, Julio Di Egidio wrote:>On 08/01/2025 17:18, David Brown wrote:>On 08/01/2025 15:42, Julio Di Egidio wrote:<snip>So you can be confident that almost anyone using your software in embedded systems will be using a 32-bit core - most likely an ARM Cortex-M, but possibly RISC-V. And they will probably be using a toolchain that supports at least C17 (some people are still on older toolchains), whether it is gcc, clang, or commercial. Certainly solid C99 support is guaranteed. Everything else is niche, and no one will be using your software on niche systems.>
Even my fridge should be able to run it... I am writing a Prolog compiler, but more generally I'd be mostly writing algorithms-data structures things.
>
That said, one thing nobody has been explaining is why C99 is superior to C89/C90, except for some coding conveniences as far as I have read online: and I must say here that I do prefer the good old ways, including style-wise, in most cases...
>
The C99 features that I consider to make code easier to write, clearer, safer, more portable, more efficient, and generally better are:
>
compound literals
designated initialisers
mixing declaration and code
variadic macros
Funny, I usually find code using such features less clear!
>I explained elsewhere how C99 is at least as portable as C90 in real life - no compiler of relevance can be used with standard C90 and not with standard C99 (perhaps excluding a few features not on my list - VLAs, complex numbers and wide character support). And even if you use nothing else from C99, use of <stdint.h> types improves portability significantly.
They would also make programs a little less portable, since they now rely on an implementation that includes support.
Les messages affichés proviennent d'usenet.