This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Calling functions through a pointerI
- From: "Toshi Morita via gcc" <gcc at gcc dot gnu dot org>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: "tm314159 at yahoo dot com" <tm314159 at yahoo dot com>
- Date: Thu, 12 Oct 2017 17:09:46 +0000 (UTC)
- Subject: Calling functions through a pointerI
- Authentication-results: sourceware.org; auth=none
- References: <2132674819.640059.1507828186637.ref@mail.yahoo.com>
- Reply-to: Toshi Morita <tm314159 at yahoo dot com>
- Reply-to: Toshi Morita <tm314159 at yahoo dot com>
This isn't a GCC question specifically - it's more of a C language question.
I'm involved in a discussion involving C language function pointers.
The other party claims calling functions through a function pointer is "undefined behavior" because it's not specifically mentioned in the C language spec.
This seems silly, because this is a common language feature used by bytecode interpreters, JITs, etc.
Can someone clarify that calling functions through a function pointer is not "undefined behavior"?
Thanks in advance.
Toshi