Skip to content

Fix -Wmissing-variable-declarations warnings on PG 18 / PG 19 builds#312

Open
devrimgunduz wants to merge 1 commit into
aws:mainfrom
devrimgunduz:main
Open

Fix -Wmissing-variable-declarations warnings on PG 18 / PG 19 builds#312
devrimgunduz wants to merge 1 commit into
aws:mainfrom
devrimgunduz:main

Conversation

@devrimgunduz

Copy link
Copy Markdown

PG 18 introduced -Wmissing-variable-declarations to PostgreSQL's
standard build flags (src/Makefile.global.in / CFLAGS_SL / bitcode
CFLAGS), which clang now applies to extension builds too. The flag
flags any file-scope, non-static variable definition that has no
prior extern declaration in scope. pg_tle defines four such globals:

* src/passcheck.c    : pass_types
* src/tleextension.c : cb_registered, tleart, tleext

All four are only used within the translation unit that defines
them (grep confirms no other .c file references them and no header
declares them extern), so they were always meant to be file-private.
They were simply never marked 'static'.

Fix:
Mark all four variables 'static'.

Hacked by Claude, tested by me.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

  PG 18 introduced -Wmissing-variable-declarations to PostgreSQL's
  standard build flags (src/Makefile.global.in / CFLAGS_SL / bitcode
  CFLAGS), which clang now applies to extension builds too. The flag
  flags any file-scope, non-static variable definition that has no
  prior extern declaration in scope. pg_tle defines four such globals:

    * src/passcheck.c    : pass_types
    * src/tleextension.c : cb_registered, tleart, tleext

  All four are only used within the translation unit that defines
  them (grep confirms no other .c file references them and no header
  declares them extern), so they were always meant to be file-private.
  They were simply never marked 'static'.

Fix:
  Mark all four variables 'static'.

Hacked by Claude, tested by me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant