Sujet : Re: "A diagram of C23 basic types"
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 03. Apr 2025, 16:52:26
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vsmaro$10v9o$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Mozilla Thunderbird
On 03/04/2025 16:26, Scott Lurndal wrote:
bart <bc@freeuk.com> writes:
On 03/04/2025 14:44, Michael S wrote:
Overhead is a smaller concern. Name clashes are bigger concern.
>
Examples? Somebody would be foolhardy to use names like 'printf' or
'exit' for their own, unrelated functions. (Compilers will anyway warn
about that.)
I've written my own printf and exit implementations in the
past. Not all C code has a runtime that provides those name.
Then you have to specify, somehow, that you don't want those automatically included.
I mean, I'm sure there are people who want to buy cars with no engine, as they will install their own, but those will be in a tiny minority.
It would make it super-annoying to have ensure you'd remembered to tick the boxes for 'engine' and '4 wheels' for 99.999% of people with normal needs.
Since I wrote my post 50 minutes minutes ago, I had to put together a test program. I started off with 'stdio.h'. Then it need to use malloc (compiler reported an error) and I needed stdlib.h.
I needed to zero that memory (need string.h for 'memset' after another compiler error).
Then I wanted to time it; now I needed time.h (another compiler error, but here I had to guess it was time.h and not sys/time.h which also exists).
It is quite exasperating. I can't even just use a header 'stdall.h' which contains all the rest, since there was a likelihood I'd have to post the test programs for others to try out, and you can't use private headers. Maybe paste a list of all 30 includes? That wouldn't be appreciated either!