Deutsch English Français Italiano |
<v2ng4n$1p3o2$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!3.eu.feeder.erje.net!feeder.erje.net!news.in-chemnitz.de!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: David Brown <david.brown@hesbynett.no> Newsgroups: comp.lang.c Subject: Re: C23 thoughts and opinions Date: Thu, 23 May 2024 15:25:43 +0200 Organization: A noiseless patient Spider Lines: 46 Message-ID: <v2ng4n$1p3o2$1@dont-email.me> References: <v2l828$18v7f$1@dont-email.me> <00297443-2fee-48d4-81a0-9ff6ae6481e4@gmail.com> <v2lji1$1bbcp$1@dont-email.me> <87msoh5uh6.fsf@nosuchdomain.example.com> <f08d2c9f-5c2e-495d-b0bd-3f71bd301432@gmail.com> <v2nbp4$1o9h6$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 23 May 2024 15:25:44 +0200 (CEST) Injection-Info: dont-email.me; posting-host="f9e44f8620308395335310dec31cb554"; logging-data="1871618"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kcaEvrC65FzXN61XQy6uGi2e4bae0z6M=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cancel-Lock: sha1:cLGmBYtU2bIHpSTfDgOorbBmvHA= Content-Language: en-GB In-Reply-To: <v2nbp4$1o9h6$1@dont-email.me> Bytes: 3175 On 23/05/2024 14:11, bart wrote: > On 23/05/2024 02:21, Thiago Adams wrote: >> Em 5/22/2024 7:53 PM, Keith Thompson escreveu: > >>> But const doesn't mean constant. It means read-only. >>> `const int r = rand();` is perfectly valid. >>> >>> I dislike the C++ hack of making N a constant expression given >>> `const int N = 42;`; constexpr made that unnecessary. C23 makes the >>> same (IMHO) mistake. >>> >>> If I had a time machine, I'd spell "const" as "readonly" and make >>> "const" mean what "constexpr" now means (evaluated at compile time). >>> >>> [...] >> >> Everything is a mess: const in C++, the differences from const in C, >> etc. constexpr in C23 just makes the mess bigger. >> >> auto is a mess as well not well specified for pointer. not sure if we >> had this topic here, but auto * p in C is not specified. >> >> I would remove from C23 >> - nullptr >> -auto >> -constexpr >> -embed >> >> I like the idea of embed but there is no implementation in production >> so this is crazy! > > 'embed' was discussed a few months ago. I disagreed with the poor way it > was to be implemented: 'embed' notionally generates a list of > comma-separated numbers as tokens, where you have to take care of any > trailing zero yourself if needed. It would also be hopelessly > inefficient if actually implemented like that. Fortunately, it is /not/ actually implemented like that - it is only implemented "as if" it were like that. Real prototype implementations (for gcc and clang - I don't know about other tools) are extremely efficient at handling #embed. And the comma-separated numbers can be more flexible in less common use-cases. (That was also made clear in the previous discussion. It's been a while since you posted much here - it's nice to see you back on form :-) )