| Deutsch English Français Italiano |
|
<vt5so1$inuo$10@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: David Brown <david.brown@hesbynett.no> Newsgroups: comp.lang.c Subject: Re: "A diagram of C23 basic types" Date: Wed, 9 Apr 2025 15:29:37 +0200 Organization: A noiseless patient Spider Lines: 32 Message-ID: <vt5so1$inuo$10@dont-email.me> 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> <20250402113624.693@kylheku.com> <86o6xdhorr.fsf@linuxsc.com> <vsn0dm$2al86$1@paganini.bofh.team> <vt15u8$df0l$1@dont-email.me> <vt2nc9$1qtjd$4@dont-email.me> <vt3p2c$2pe3r$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 09 Apr 2025 15:29:37 +0200 (CEST) Injection-Info: dont-email.me; posting-host="39048323a720df50869558e92437b3ec"; logging-data="614360"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+YEMaBMGk601zEIX9Z1KeV20WX3hBvhyE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cancel-Lock: sha1:K6Ddz8xitdGnxQkFd2xr90OqfbE= In-Reply-To: <vt3p2c$2pe3r$1@dont-email.me> Content-Language: en-GB Bytes: 2784 On 08/04/2025 20:14, James Kuyper wrote: > On 4/8/25 04:39, David Brown wrote: >> On 07/04/2025 20:35, James Kuyper wrote: >>> On 4/3/25 18:00, Waldek Hebisch wrote: >>>> Tim Rentsch <tr.17687@z991.linuxsc.com> wrote: >>> ... >>>>> Not always practical. A good example is the type size_t. If a >>>>> function takes an argument of type size_t, then the symbol size_t >>>>> should be defined, no matter which header the function is being >>>>> declared in. >>>> >>>> Why? One can use a type without a name for such type. >>> >>> How would you declare a pointer to a function type such that it is >>> compatible with such a function's type? >> >> The C23 "typeof" operator lets you work with the type of a value or >> expression. So you first have an object or value of type "size_t", >> that's all you need. Unfortunately, there are no convenient literal >> suffixes that could be used here. > > I can see how that would work with the return type of a function, but > how would it apply to an argument of a function? > Something like : memcpy(p, q, (typeof(sizeof(int))) 100); I haven't tested that on a C23 compiler, because I really don't think it is the kind of thing I'd write in real code!