Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 58bc481

Browse files
committed
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.
1 parent 473ab40 commit 58bc481

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/backend/tcop/utility.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,9 @@ ProcessUtility(Node *parsetree,
380380
*/
381381
#define UTILITY_BEGIN_QUERY(isComplete) \
382382
do { \
383-
bool _needCleanup = false; \
383+
bool _needCleanup; \
384384
\
385-
if (isComplete) \
386-
{ \
387-
_needCleanup = EventTriggerBeginCompleteQuery(); \
388-
} \
385+
_needCleanup = (isComplete) && EventTriggerBeginCompleteQuery(); \
389386
\
390387
PG_TRY(); \
391388
{ \

0 commit comments

Comments
 (0)