Skip to content

Commit 3612019

Browse files
committed
doc: Document function pointer source code style
as implemented in 1356f78
1 parent 821fb8c commit 3612019

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

doc/src/sgml/sources.sgml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,5 +964,23 @@ handle_sighup(SIGNAL_ARGS)
964964
</para>
965965
</simplesect>
966966

967+
<simplesect>
968+
<title>Calling Function Pointers</title>
969+
970+
<para>
971+
For clarity, it is preferred to explicitly dereference a function pointer
972+
when calling the pointed-to function if the pointer is a simple variable,
973+
for example:
974+
<programlisting>
975+
(*emit_log_hook) (edata);
976+
</programlisting>
977+
(even though <literal>emit_log_hook(edata)</literal> would also work).
978+
When the function pointer is part of a structure, then the extra
979+
punctuation can and usually should be omitted, for example:
980+
<programlisting>
981+
paramInfo->paramFetch(paramInfo, paramId);
982+
</programlisting>
983+
</para>
984+
</simplesect>
967985
</sect1>
968986
</chapter>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy