Review
fix more casting away of qualifiers (v3)
- Proposal version
- 3
- Base commit
- 412848dac37f2e4455e1505f83f0af0f3d28a67d
Assessment
The patch series continues ongoing cleanup aimed at enabling -Wcast-qual compiler warnings across PostgreSQL:
- Patch 0001 modifies float4in_internal() and float8in_internal() to take "const char *num", eliminating casts in callers that parse read- only strings.
- Patch 0002 addresses volatile qualifiers on shared-memory signal structures, moving volatile from the aggregate PMSignalData pointer to individual members, and replaces MemSet() invocations with explicit initialization loops.
Both patches were applied on base commit 412848dac37f2e4455e1505f83f0af0f3d28a67d and passed the full regression test suite (239 tests).
Implementation caveat: During compilation, a compiler warning is emitted in src/backend/storage/ipc/procsignal.c:158: "warning: declaration of 'i' shadows a previous local [-Wshadow=compatible-local]" because the new loop "for (int i = 0; i < NUM_PROCSIGNALS; i++)" shadows the enclosing "for (int i = 0; i < NumProcSignalSlots; ++i)" loop at line 151. This variable shadowing should be renamed (e.g. to j or sig) before commit.
Discussion and Consensus
The thread reflects active review by Andres Freund, Heikki Linnakangas, and Rui Zhao. Earlier patches from the v1/v2 series have already been committed. Andres raised aesthetic concerns regarding unconstify() usage around strtod/endptr_p, while Rui Zhao caught comment discrepancies. The series is close to ready once the shadowed loop index is resolved.