On 24.11.26 14:04, Andrei Lepikhov wrote:
Building current master on macOS with a recent clang, I still get two of these
warnings, both in psql:

input.c:36:12: warning: variable 'history_lines_added' set but not used
[-Wunused-but-set-global]
tab-complete.in.c:225:13: warning: variable 'completion_last_char' set but not
used [-Wunused-but-set-global]

They only appear when psql is linked against a line-editing library that lacks
some optional functions, such as libedit, which ships with macOS. That is
probably why they didn't show up in your build.

See the sketch solution in the attached patch.

Maybe for cases like this it would be easier to stick a pg_attribute_unused() on the variable declarations. Otherwise, it might get too annoying to maintain all these #ifdef groups consistently.



Reply via email to