diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index e9288bd6b5e..70e815b8a2c 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -4029,7 +4029,7 @@ extern PgStat_Kind pgstat_register_kind(PgStat_Kind kind, All functions accessed by the backend must present a C interface to the backend; these C functions can then call C++ functions. - For example, extern C linkage is required for + For example, extern "C" linkage is required for backend-accessed functions. This is also necessary for any functions that are passed as pointers between the backend and C++ code. @@ -4046,7 +4046,7 @@ extern PgStat_Kind pgstat_register_kind(PgStat_Kind kind, Prevent exceptions from propagating into the C code (use a catch-all - block at the top level of all extern C functions). This + block at the top level of all extern "C" functions). This is necessary even if the C++ code does not explicitly throw any exceptions, because events like out-of-memory can still throw exceptions. Any exceptions must be caught and appropriate errors @@ -4070,7 +4070,7 @@ extern PgStat_Kind pgstat_register_kind(PgStat_Kind kind, In summary, it is best to place C++ code behind a wall of - extern C functions that interface to the backend, + extern "C" functions that interface to the backend, and avoid exception, memory, and call stack leakage.