Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: C23 thoughts and opinions Date: Tue, 28 May 2024 13:21:26 -0700 Organization: None to speak of Lines: 30 Message-ID: <874jahznzt.fsf@nosuchdomain.example.com> References: <00297443-2fee-48d4-81a0-9ff6ae6481e4@gmail.com> <87msoh5uh6.fsf@nosuchdomain.example.com> <87y18047jk.fsf@nosuchdomain.example.com> <87msoe1xxo.fsf@nosuchdomain.example.com> <87ikz11osy.fsf@nosuchdomain.example.com> <87plt8yxgn.fsf@nosuchdomain.example.com> <87cyp6zsen.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Tue, 28 May 2024 22:21:30 +0200 (CEST) Injection-Info: dont-email.me; posting-host="503aa67d7af20ebe92003f0d26656eca"; logging-data="805022"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+p6/sTvyBjIMlo59LNvE0B" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:FHcZMVOW8tlO9LxU5sjFtATgBe4= sha1:3ja7W4MyhjNNTo2gs9o1ziy+7sg= Bytes: 2865 David Brown writes: > On 28/05/2024 02:33, Keith Thompson wrote: [...] >> Without some kind of programmer control, I'm concerned that the rules >> for defining an array so #embed will be correctly optimized will be >> spread as lore rather than being specified anywhere. > > They might, but I really do not think that is so important, since they > will not affect the generated results. Right, it won't affect the generated results (assuming I use it correctly). Unless I use `#embed optimize(true)` to initialize a struct with varying member sizes, but that's my fault because I asked for it. The point is compile-timer performance, and perhaps even the ability to compile at all. I'm thinking about hypothetical cases where I want to embed a *very* large file and parsing the comma-delimited sequence could have unacceptable compile-time performance, perhaps even causing a compile-time stack overflow depending on how the parser works. Every time the compiler sees #embed, it has to decide whether to optimize it or not, and the decision criteria are not specified anywhere (not at all in the standard, perhaps not clearly in the compiler's documentation). -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */