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

Commit 4172bd8

Browse files
committed
Suppress some "variable might be clobbered by longjmp" warnings.
Seen with an older gcc version. I'm not sure these represent any real risk factor, but still a bit scary. Anyway we have lots of other volatile-marked variables in this code, so a couple more won't hurt.
1 parent dfe18f1 commit 4172bd8

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

src/pl/plperl/Util.xs

+19-18
Original file line numberDiff line numberDiff line change
@@ -36,37 +36,38 @@
3636
static void
3737
do_util_elog(int level, SV *msg)
3838
{
39-
MemoryContext oldcontext = CurrentMemoryContext;
40-
char *cmsg = NULL;
39+
MemoryContext oldcontext = CurrentMemoryContext;
40+
char * volatile cmsg = NULL;
4141

42-
PG_TRY();
43-
{
42+
PG_TRY();
43+
{
4444
cmsg = sv2cstr(msg);
45-
elog(level, "%s", cmsg);
45+
elog(level, "%s", cmsg);
4646
pfree(cmsg);
47-
}
48-
PG_CATCH();
49-
{
50-
ErrorData *edata;
47+
}
48+
PG_CATCH();
49+
{
50+
ErrorData *edata;
5151

52-
/* Must reset elog.c's state */
53-
MemoryContextSwitchTo(oldcontext);
54-
edata = CopyErrorData();
55-
FlushErrorState();
52+
/* Must reset elog.c's state */
53+
MemoryContextSwitchTo(oldcontext);
54+
edata = CopyErrorData();
55+
FlushErrorState();
5656

5757
if (cmsg)
5858
pfree(cmsg);
5959

60-
/* Punt the error to Perl */
61-
croak("%s", edata->message);
62-
}
63-
PG_END_TRY();
60+
/* Punt the error to Perl */
61+
croak("%s", edata->message);
62+
}
63+
PG_END_TRY();
6464
}
6565

6666
static text *
6767
sv2text(SV *sv)
6868
{
69-
char *str = sv2cstr(sv);
69+
char *str = sv2cstr(sv);
70+
7071
return cstring_to_text(str);
7172
}
7273

src/pl/plpython/plpython.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ static PLyProcedure *
15161516
PLy_procedure_get(Oid fn_oid, bool is_trigger)
15171517
{
15181518
HeapTuple procTup;
1519-
PLyProcedureEntry *entry;
1519+
PLyProcedureEntry * volatile entry;
15201520
bool found;
15211521

15221522
procTup = SearchSysCache1(PROCOID, ObjectIdGetDatum(fn_oid));
@@ -3234,7 +3234,7 @@ PLy_spi_prepare(PyObject *self, PyObject *args)
32343234
void *tmpplan;
32353235
volatile MemoryContext oldcontext;
32363236
volatile ResourceOwner oldowner;
3237-
int nargs;
3237+
volatile int nargs;
32383238

32393239
if (!PyArg_ParseTuple(args, "s|O", &query, &list))
32403240
return NULL;
@@ -3470,7 +3470,7 @@ PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit)
34703470

34713471
PG_TRY();
34723472
{
3473-
char *nulls;
3473+
char * volatile nulls;
34743474
volatile int j;
34753475

34763476
if (nargs > 0)

0 commit comments

Comments
 (0)