From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Cc: | PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Compiler warning in costsize.c |
Date: | 2017-04-04 17:54:19 |
Message-ID: | 20362.1491328459@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> In builds where USE_ASSERT_CHECKING is not enabled, costsize.c can
> generate warnings. Here is for example with MSVC:
> src/backend/optimizer/path/costsize.c(4520): warning C4101: 'rte' : unreferenced local variable [C:\Users\ioltas\git\postgres\postgres.vcxproj]
> src/backend/optimizer/path/costsize.c(4640): warning C4101: 'rte' : unreferenced local variable [C:\Users\ioltas\git\postgres\postgres.vcxproj]
> a9c074ba7 has done an effort, but a bit more is needed as the attached.
That doesn't look right at all:
+#ifdef USE_ASSERT_CHECKING
RangeTblEntry *rte PG_USED_FOR_ASSERTS_ONLY;
+#endif
The entire point of the PG_USED_FOR_ASSERTS_ONLY annotation is to suppress
this type of warning without a need for an explicit #ifdef like that one.
We should either fix PG_USED_FOR_ASSERTS_ONLY to work on MSVC as well,
or decide that we don't care about suppressing such warnings on MSVC,
or give up on PG_USED_FOR_ASSERTS_ONLY and remove it everywhere in
favor of plain #ifdefs.
(I'm personally not that much in love with PG_USED_FOR_ASSERTS_ONLY,
because it tends to confuse pgindent.)
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Petr Jelinek | 2017-04-04 18:08:17 | Re: logical replication launcher crash on buildfarm |
Previous Message | Tomas Vondra | 2017-04-04 17:52:29 | Re: strange parallel query behavior after OOM crashes |