Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Abstract Syntax Tree for C programs Date: Wed, 05 Jun 2019 21:45:52 -0700 Organization: None to speak of Lines: 24 Message-ID: References: <87ftop38c1.fsf@bsb.me.uk> <98193656-76f0-4718-9a97-a24ba0aa9b7c@googlegroups.com> <4ff90bb7-33e5-4dcd-828f-b0d40f237420@googlegroups.com> <8a72685f-2774-4187-98bf-c9ecd44b3240@googlegroups.com> <6ed2dfc1-a737-4fb3-b59a-3aa1c337061d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="0ad8b66ef2f1a8fe8c740ae2f33d0263"; logging-data="8053"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194wiEetWzNXijXPkuoXu1e" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:qzqd97doXTlUnnSeExosMTGdUTg= sha1:FRrx40/wRqCHUDtENPE9kiCgoLE= Xref: csiph.com comp.lang.c:144514 Keith Thompson writes: [...] > "gcc -std=c11 -pedantic" warns that "ISO C forbids conversion of > object pointer to function pointer type". I believe that message is > incorrect. ISO C doesn't define the behavior of such a conversion, > but it doesn't forbid it (it doesn't violate a constraint or syntax > rule). But if you're writing code that depends on POSIX features, > you're probably not going to use "-std=c11 -pedantic". I reported this as a bug in gcc back in 2017: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83584 (I disagree with the way it's been resolved, but I suggest not re-arguing that here. I think we've discussed it before.) FWIW, clang doesn't complain about the pointer conversion, even with "-std=c11 -Weverything". I might argue that it *should* complain about it with "-Weverything", but not with "-pedantic". -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */