summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2013-03-28 17:19:49 +0000
committerTom Lane2013-03-28 17:19:49 +0000
commit58bc48179b3cad0793ae20b002d60289c8bf0b9b (patch)
tree1cf7efc700ca2de94e9301a5e09d2082858e8661
parent473ab40c8bb3fcb1a7645f6a7443a0424d70fbaf (diff)
Avoid "variable might be clobbered by longjmp" warning.
On older-model gcc, the original coding of UTILITY_BEGIN_QUERY() can draw this error because of multiple assignments to _needCleanup. Rather than mark that variable volatile, we can suppress the warning by arranging to have just one unconditional assignment before PG_TRY.
-rw-r--r--src/backend/tcop/utility.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index 77b4e5368e7..954040cfb85 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -380,12 +380,9 @@ ProcessUtility(Node *parsetree,
*/
#define UTILITY_BEGIN_QUERY(isComplete) \
do { \
- bool _needCleanup = false; \
+ bool _needCleanup; \
\
- if (isComplete) \
- { \
- _needCleanup = EventTriggerBeginCompleteQuery(); \
- } \
+ _needCleanup = (isComplete) && EventTriggerBeginCompleteQuery(); \
\
PG_TRY(); \
{ \