Deutsch English Français Italiano |
<87sewhuh7c.fsf@nosuchdomain.example.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson <Keith.S.Thompson+u@gmail.com> Newsgroups: comp.lang.c Subject: Re: technology discussion =?utf-8?Q?=E2=86=92?= does the world need a "new" C ? Date: Wed, 10 Jul 2024 13:26:15 -0700 Organization: None to speak of Lines: 39 Message-ID: <87sewhuh7c.fsf@nosuchdomain.example.com> References: <v66eci$2qeee$1@dont-email.me> <v6d779$6rk5$2@dont-email.me> <v6e76u$c0i9$1@dont-email.me> <v6esqm$fian$2@dont-email.me> <v6f7vg$hgam$1@dont-email.me> <20240707164747.258@kylheku.com> <v6gl83$s72a$1@dont-email.me> <v6h8ao$ur1v$1@dont-email.me> <v6jhk3$1drd6$1@dont-email.me> <v6jiud$1dsjb$1@dont-email.me> <877cdur1z9.fsf@bsb.me.uk> <v6joi4$1epoj$1@dont-email.me> <871q42qy33.fsf@bsb.me.uk> <v6k6i0$1h4d3$1@dont-email.me> <87ed82p28y.fsf@bsb.me.uk> <v6m03l$1tf05$1@dont-email.me> <87r0c1nzjj.fsf@bsb.me.uk> <v6m716$1urj4$1@dont-email.me> <86ikxd8czu.fsf@linuxsc.com> <v6mggd$20g3f$1@dont-email.me> <20240710213910.00000afd@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Wed, 10 Jul 2024 22:26:16 +0200 (CEST) Injection-Info: dont-email.me; posting-host="2ff96a67704e58776cf4f9c1dffac965"; logging-data="2150127"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ctTzr0c17TiegOumsJvNP" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:oEwgYLaYfwbfD35XrNN7tX54yhI= sha1:am4gpYfiiOc8lXQMNWyMunqowVI= Bytes: 3359 Michael S <already5chosen@yahoo.com> writes: [...] > It does not count, because automatic conversion to a pointer is not > something that happens only during parameter passing. For arrays, it > happens in all contexts except sizeof(). For functions, it happens in > all contexts except function call. Or, may be, including function call, > in this case (but not in case of arrays) it depends on point of view. The rules are stated in section 6.3.2.1 (same subsection number in N1570/C11 and N3220/C23). Array expressions "decay" to pointers in all contexts except: - The operand of "sizeof" - The operand of unary "&" - The operand of a typeof operator (introduced in C23) - A string literal used to initialize an array A function designator (an expression of function type) decays to a pointer in all contexts except: - The operand of "sizeof" (`sizeof func` is a constraint violation) - The operand of a typeof operator (introduced in C23) - The operand of unary "&" The prefix of a function call is required to be of pointer-to-function type. C *could* have required the prefix of a function call to be of function type. It would have had to add another context to the rules for function designator decay, plus a rule that an expression of pointer-to-function type is implicitly dereferenced if it's the prefix of a function call. Unless I'm missing something (which is always possible), this would have made no effective difference to the syntax or semantics of the language. But it's consistently defined the way it is, and if we're going to get into the fine details I think it's important to understand the rules. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */