Deutsch English Français Italiano |
<20250402113624.693@kylheku.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <643-408-1753@kylheku.com> Newsgroups: comp.lang.c Subject: Re: "A diagram of C23 basic types" Date: Wed, 2 Apr 2025 18:51:34 -0000 (UTC) Organization: A noiseless patient Spider Lines: 45 Message-ID: <20250402113624.693@kylheku.com> References: <87y0wjaysg.fsf@gmail.com> <vsj1m8$1f8h2$1@dont-email.me> <vsj2l9$1j0as$1@dont-email.me> <vsjef3$1u4nk$1@dont-email.me> <vsjg6t$20pdb$1@dont-email.me> <vsjjd1$23ukt$1@dont-email.me> <vsjkvb$25mtg$1@dont-email.me> <vsjlkq$230a5$2@dont-email.me> <vsjs5k$2bfc5$2@dont-email.me> <vsjvgu$2fpp1$1@dont-email.me> Injection-Date: Wed, 02 Apr 2025 20:51:34 +0200 (CEST) Injection-Info: dont-email.me; posting-host="f018e176a62d053c1923411f75e9ac2f"; logging-data="2624500"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8Wl3zpp96bd1/7ZCgG/FB3NLReCan/ok=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:QZN+9XEaYILR4gqrhVTYNpaT5NI= Bytes: 2930 On 2025-04-02, bart <bc@freeuk.com> wrote: > So it is not true that you need include stddef.h, nor obvious that that > is where NULL is defined, if you are used to having it available indirectly. It's documented as the canonical source of NULL. In C90, now 35 years ago, it was written up like this: 7.1.6 Common definitions <stddef.h> The following types and macros are defined in the standard header <stddef.h>. Some are also defined in other headers, as noted in their respective subclauses. ... The macros are NULL which expands to an implementation-defined null pointer constant: and offsetof(type, member-designator) ... etc There is no other easy way to find that out. An implementation could directly stick #define NULL into every header that is either allowed or required to reveal that macro, and so from that you would not know which headers are required to provide it. Many things are not going to be "obvious" if you don't use documentation. (In my opinion, things would be better if headers were not allowed to behave as if they include other headers, or provide identifiers also given in other heards. Not in ISO C, and not in POSIX. Every identifier should be declared in exactly one home header, and no other header should provide that definition. Programs ported from one Unix to another sometimes break for no other reason than this! On the original platform, a header provided a certain identifier which it is not required to; on the new platform that same header doesn't do that.) -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca