On Sunday, December 11, 2022 at 6:04:20 PM UTC-8,
muta...@gmail.com wrote:
...
> And also, with the advent of these public domain compilers,
> I am willing to upgrade language after about 35 years of
> coding to C90 (the ANSI C draft was available earlier than
> 1990).
>
> But I would like to discuss an acceptable language.
>
> I consider C99 to be an abortion.
There are some nice and small C99 features:
- // comments
- __func__
- removal of implicit int and implicit function declaration
(true abominations/abortions of the early C)
- hex floating point constants and %a format conversion specifier
- <stdint.h> types and <inttypes.h> to go with it
- strictly defined signed integer division
- declarations (almost) anywhere (including for())
- flexible array member at struct's end
- non-const initializers of automatic variables
- compound literals
- designated initializers (specifically, .name=...;
go especially well with compound literals)
- trailing commas in initializers and enum declarations
- inline (most notably in combination with static)
- type punning via unions (somewhat better than memcpy())
- a few more <math.h> functions, in particular, rounding
and rounding-like functions
- overall improvements in floating point support, including
INFINITY, NAN, etc
From recent standards it's also nice to have:
- anonymous union member
- static assertions
Things I dislike:
- old/K&R-style declarations
- tentative definitions
- variable-length arrays (bad idea to have arbitrarily large
stuff on the stack)
- too much UB, especially creeping UB, little help from
the language proper or its library to deal with UB
Things I don't care much about:
- complex numbers (real scientists may disagree)
There's more to speak about, but this likely covers most of it.
Alex