File tree 1 file changed +7
-0
lines changed 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,13 @@ extern PGDLLIMPORT ErrorContextCallback *error_context_stack;
332
332
* not without taking thought for what will happen during ereport(FATAL).
333
333
* The PG_ENSURE_ERROR_CLEANUP macros provided by storage/ipc.h may be
334
334
* helpful in such cases.
335
+ *
336
+ * Note: if a local variable of the function containing PG_TRY is modified
337
+ * in the PG_TRY section and used in the PG_CATCH section, that variable
338
+ * must be declared "volatile" for POSIX compliance. This is not mere
339
+ * pedantry; we have seen bugs from compilers improperly optimizing code
340
+ * away when such a variable was not marked. Beware that gcc's -Wclobbered
341
+ * warnings are just about entirely useless for catching such oversights.
335
342
*----------
336
343
*/
337
344
#define PG_TRY () \
You can’t perform that action at this time.
0 commit comments