pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix "variable set but not used" warning with unnamed POSIX semap 7+ messages / 1 participants [nested] [flat]
* pgsql: Fix "variable set but not used" warning with unnamed POSIX semap @ 2026-10-25 22:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-25 22:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "variable set but not used" warning with unnamed POSIX semaphores. Late-model clang is able to notice, when building posix_sema.c with USE_NAMED_POSIX_SEMAPHORES not defined, that the static variable nextSemKey is set once and read nowhere. Rearrange the #ifdef's to not declare or set it unless USE_NAMED_POSIX_SEMAPHORES. As a small side benefit, we can skip a stat() call altogether if we're not going to need it to initialize this variable, which I think clarifies the code a fraction. Per buildfarm member fritillary. Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/6e06f62816fc99e7cc2e5ea8210fe413916d74cf Modified Files -------------- src/backend/port/posix_sema.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix "variable set but not used" warning with unnamed POSIX semap @ 2026-10-25 22:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-25 22:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "variable set but not used" warning with unnamed POSIX semaphores. Late-model clang is able to notice, when building posix_sema.c with USE_NAMED_POSIX_SEMAPHORES not defined, that the static variable nextSemKey is set once and read nowhere. Rearrange the #ifdef's to not declare or set it unless USE_NAMED_POSIX_SEMAPHORES. As a small side benefit, we can skip a stat() call altogether if we're not going to need it to initialize this variable, which I think clarifies the code a fraction. Per buildfarm member fritillary. Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e406c4e7ad22f0140d73a19eaa0765e5d765283e Modified Files -------------- src/backend/port/posix_sema.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix "variable set but not used" warning with unnamed POSIX semap @ 2026-10-25 22:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-25 22:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "variable set but not used" warning with unnamed POSIX semaphores. Late-model clang is able to notice, when building posix_sema.c with USE_NAMED_POSIX_SEMAPHORES not defined, that the static variable nextSemKey is set once and read nowhere. Rearrange the #ifdef's to not declare or set it unless USE_NAMED_POSIX_SEMAPHORES. As a small side benefit, we can skip a stat() call altogether if we're not going to need it to initialize this variable, which I think clarifies the code a fraction. Per buildfarm member fritillary. Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b9662d4be6c7e2a762877c13caa46fd83107004d Modified Files -------------- src/backend/port/posix_sema.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix "variable set but not used" warning with unnamed POSIX semap @ 2026-10-25 22:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-25 22:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "variable set but not used" warning with unnamed POSIX semaphores. Late-model clang is able to notice, when building posix_sema.c with USE_NAMED_POSIX_SEMAPHORES not defined, that the static variable nextSemKey is set once and read nowhere. Rearrange the #ifdef's to not declare or set it unless USE_NAMED_POSIX_SEMAPHORES. As a small side benefit, we can skip a stat() call altogether if we're not going to need it to initialize this variable, which I think clarifies the code a fraction. Per buildfarm member fritillary. Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/313288df8f9f34026cd33980e838d22b8b0001d9 Modified Files -------------- src/backend/port/posix_sema.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix "variable set but not used" warning with unnamed POSIX semap @ 2026-10-25 22:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-25 22:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "variable set but not used" warning with unnamed POSIX semaphores. Late-model clang is able to notice, when building posix_sema.c with USE_NAMED_POSIX_SEMAPHORES not defined, that the static variable nextSemKey is set once and read nowhere. Rearrange the #ifdef's to not declare or set it unless USE_NAMED_POSIX_SEMAPHORES. As a small side benefit, we can skip a stat() call altogether if we're not going to need it to initialize this variable, which I think clarifies the code a fraction. Per buildfarm member fritillary. Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9403b87c0010a6d9b88a880ae14dec48b4e30cc3 Modified Files -------------- src/backend/port/posix_sema.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix "variable set but not used" warning with unnamed POSIX semap @ 2026-10-25 22:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-25 22:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "variable set but not used" warning with unnamed POSIX semaphores. Late-model clang is able to notice, when building posix_sema.c with USE_NAMED_POSIX_SEMAPHORES not defined, that the static variable nextSemKey is set once and read nowhere. Rearrange the #ifdef's to not declare or set it unless USE_NAMED_POSIX_SEMAPHORES. As a small side benefit, we can skip a stat() call altogether if we're not going to need it to initialize this variable, which I think clarifies the code a fraction. Per buildfarm member fritillary. Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a45e1d0ee7486a3278739cd8d895902173f90b0d Modified Files -------------- src/backend/port/posix_sema.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix "variable set but not used" warning with unnamed POSIX semap @ 2026-10-25 22:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-25 22:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "variable set but not used" warning with unnamed POSIX semaphores. Late-model clang is able to notice, when building posix_sema.c with USE_NAMED_POSIX_SEMAPHORES not defined, that the static variable nextSemKey is set once and read nowhere. Rearrange the #ifdef's to not declare or set it unless USE_NAMED_POSIX_SEMAPHORES. As a small side benefit, we can skip a stat() call altogether if we're not going to need it to initialize this variable, which I think clarifies the code a fraction. Per buildfarm member fritillary. Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/cfd97fa13d15f8138a6046173f6bd6dbd6b3c63e Modified Files -------------- src/backend/port/posix_sema.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2026-10-25 22:19 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-10-25 22:19 pgsql: Fix "variable set but not used" warning with unnamed POSIX semap Tom Lane <tgl@sss.pgh.pa.us> 2026-10-25 22:19 pgsql: Fix "variable set but not used" warning with unnamed POSIX semap Tom Lane <tgl@sss.pgh.pa.us> 2026-10-25 22:19 pgsql: Fix "variable set but not used" warning with unnamed POSIX semap Tom Lane <tgl@sss.pgh.pa.us> 2026-10-25 22:19 pgsql: Fix "variable set but not used" warning with unnamed POSIX semap Tom Lane <tgl@sss.pgh.pa.us> 2026-10-25 22:19 pgsql: Fix "variable set but not used" warning with unnamed POSIX semap Tom Lane <tgl@sss.pgh.pa.us> 2026-10-25 22:19 pgsql: Fix "variable set but not used" warning with unnamed POSIX semap Tom Lane <tgl@sss.pgh.pa.us> 2026-10-25 22:19 pgsql: Fix "variable set but not used" warning with unnamed POSIX semap Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox