Hi hackers,
while reviewing [1], I noticed a remaining "cast discards ‘volatile’" outside of
c.h:
$ grep " warning: cast discards ‘volatile’" make.log
vacuum.c:1885:46: warning: cast discards ‘volatile’ qualifier from pointer target type [-Wcast-qual]
c.h:1263:10: warning: cast discards ‘volatile’ qualifier from pointer target type [-Wcast-qual]
c.h:1039:35: warning: cast discards ‘volatile’ qualifier from pointer target type [-Wcast-qual]
c.h:1039:35: warning: cast discards ‘volatile’ qualifier from pointer target type [-Wcast-qual]
c.h:1263:10: warning: cast discards ‘volatile’ qualifier from pointer target type [-Wcast-qual]
c.h:1263:10: warning: cast discards ‘volatile’ qualifier from pointer target type [-Wcast-qual]
c.h:1263:10: warning: cast discards ‘volatile’ qualifier from pointer target type [-Wcast-qual]
That indicated that unvolatize() is not being used in vacuum.c. Indeed, 481018f2804
introduced unvolatize() but its usage has been missed in c66a7d75e652.
This patch makes use of unvolatize() in vac_truncate_clog().
Note that it does not remove the warning but moves it to c.h (where unvolatize()
is defined) but that's consistent with what 481018f2804 did too.
[1]: https://postgr.es/m/aZw4fcj1qBYgN41V%40ip-10-97-1-34.eu-west-3.compute.internal
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com