From 3612019a7925012445af29b9ea7af84bd68a5932 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 11 Sep 2017 14:47:15 -0400 Subject: [PATCH] doc: Document function pointer source code style as implemented in 1356f78ea93395c107cbc75dc923e29a0efccd8a --- doc/src/sgml/sources.sgml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml index 877fcedbb3a..7777bf51995 100644 --- a/doc/src/sgml/sources.sgml +++ b/doc/src/sgml/sources.sgml @@ -964,5 +964,23 @@ handle_sighup(SIGNAL_ARGS) + + Calling Function Pointers + + + For clarity, it is preferred to explicitly dereference a function pointer + when calling the pointed-to function if the pointer is a simple variable, + for example: + +(*emit_log_hook) (edata); + + (even though emit_log_hook(edata) would also work). + When the function pointer is part of a structure, then the extra + punctuation can and usually should be omitted, for example: + +paramInfo->paramFetch(paramInfo, paramId); + + + -- 2.39.5