Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #349688
| Path | csiph.com!news.mixmin.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Tim Rentsch <tr.17687@z991.linuxsc.com> |
| Newsgroups | comp.lang.c |
| Subject | Re: Call to a function |
| Date | Tue, 24 Oct 2023 20:54:54 -0700 |
| Organization | A noiseless patient Spider |
| Lines | 29 |
| Message-ID | <86ttqf2w6p.fsf@linuxsc.com> (permalink) |
| References | <call-20230922130647@ram.dialup.fu-berlin.de> <20230922081706.858@kylheku.com> <87zg1et4wv.fsf@nosuchdomain.example.com> <86jzs3de3h.fsf@linuxsc.com> <87h6n7tkv4.fsf@nosuchdomain.example.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Info | dont-email.me; posting-host="cf97bd7e9489cbbcf364cc78b48cedaf"; logging-data="541043"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19clx0E9smenPHZP/CHhBKAy16a5FFAMg8=" |
| User-Agent | Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) |
| Cancel-Lock | sha1:uyzzGmv4siMPIW7n9xKsvvSBWCQ= sha1:OnEyTTR7nfMnXczzz47zV9p3pms= |
| Xref | csiph.com comp.lang.c:349688 |
Show key headers only | View raw
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes: > Tim Rentsch <tr.17687@z991.linuxsc.com> writes: > [...] > >> The point isn't quite the same. The C standard explicitly says >> integers may be converted to any pointer type. The C standard >> does not say that a pointer to an object type may be converted >> to a pointer to function type. Every implementation is within >> its rights to reject any program whose static text includes[*] a >> cast from a pointer to an object type to a pointer to function >> type, regardless of whether the cast has any chance of being >> executed. >> >> [*] meaning, still present as source of any preprocessor >> conditionals have been processed, etc. > > I disagree. (I think we've discussed this before.) > > Concretely, I believe that this program violates no syntax error > or constraint. It includes code whose behavior would be undefined > if it were executed, but the `if (0)` prevents that. > > On what basis do you think a conforming implementation may reject > it? First let me ask a question. Does the C standard allow an implementation to reject any program that is not strictly conforming?
Back to comp.lang.c | Previous | Next — Next in thread | Find similar | Unroll thread
Re: Call to a function Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-10-24 20:54 -0700
Re: Call to a function Richard Damon <richard@damon-family.org> - 2023-10-24 21:27 -0700
Re: Call to a function Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-10-24 21:58 -0700
Re: Call to a function James Kuyper <jameskuyper@alumni.caltech.edu> - 2023-10-25 01:13 -0400
Re: Call to a function Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-25 06:46 +0000
Re: Call to a function Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-25 06:37 +0000
csiph-web