Sujet : Re: question about nullptr
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.cDate : 07. Jul 2024, 11:07:35
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6dpd9$9qv4$1@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
On 07/07/2024 10:00, Lawrence D'Oliveiro wrote:
On Sat, 6 Jul 2024 18:57:08 +0200, David Brown wrote:
... and for C compilers to support a flag like gcc's "-Wzero-as-null
-pointer-constant" warning ...
The trouble with compiler flags is they can never be part of any language
spec.
That is both their advantage, and their disadvantage.
Let the C standards define what the language requires when the source code is correct, and have everyone agree on that. Let compiler implementations go beyond that and give options that some might want, and others not want. /I/ will probably use nullptr in C23 coding, and I like tools to enforce my style (because I make mistakes) but I would certainly not want to force others to change their style based on /my/ preferences.