File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff 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>
You can’t perform that action at this time.
0 commit comments