On 09/05/2024 12:23, Peter Eisentraut wrote:
In [0] I had noticed that we have no automated verification that global variables are declared in header files. (For global functions, we have this through -Wmissing-prototypes.) As I mentioned there, I discovered the Clang compiler option -Wmissing-variable-declarations, which does exactly that. Clang has supported this for quite some time, and GCC 14, which was released a few days ago, now also supports it. I went and installed this option into the standard build flags and cleaned up the warnings it found, which revealed a number of interesting things.
Nice! More checks like this is good in general.
Attached are patches organized by sub-topic. The most dubious stuff is in patches 0006 and 0007. A bunch of GUC-related variables are not in header files but are pulled in via ad-hoc extern declarations. I can't recognize an intentional scheme there, probably just done for convenience or copied from previous practice. These should be organized into appropriate header files.
+1 for moving all these to header files. Also all the "other stuff" in patch 0007.
-- Heikki Linnakangas Neon (https://neon.tech)