Re: pgsql: Convert some extern variables to static

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Convert some extern variables to static
Date: 2024-09-19 23:15:28
Message-ID: 2078838.1726787728@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> Convert some extern variables to static

I'm surprised it took me so long to notice, but this commit
makes headerscheck unhappy:

$ src/tools/pginclude/headerscheck
In file included from /tmp/headerscheck.40tbNq/test.c:2:
./contrib/isn/EAN13.h:26:20: warning: 'EAN13_range' defined but not used [-Wunused-variable]
static const char *EAN13_range[][2] = {
^~~~~~~~~~~
In file included from /tmp/headerscheck.40tbNq/test.c:2:
./contrib/isn/ISBN.h:983:20: warning: 'ISBN_range_new' defined but not used [-Wunused-variable]
static const char *ISBN_range_new[][2] = {
^~~~~~~~~~~~~~
./contrib/isn/ISBN.h:50:20: warning: 'ISBN_range' defined but not used [-Wunused-variable]
static const char *ISBN_range[][2] = {
^~~~~~~~~~
In file included from /tmp/headerscheck.40tbNq/test.c:2:
./contrib/isn/ISMN.h:45:20: warning: 'ISMN_range' defined but not used [-Wunused-variable]
static const char *ISMN_range[][2] = {
^~~~~~~~~~
In file included from /tmp/headerscheck.40tbNq/test.c:2:
./contrib/isn/ISSN.h:46:20: warning: 'ISSN_range' defined but not used [-Wunused-variable]
static const char *ISSN_range[][2] = {
^~~~~~~~~~
In file included from /tmp/headerscheck.40tbNq/test.c:2:
./contrib/isn/UPC.h:26:20: warning: 'UPC_range' defined but not used [-Wunused-variable]
static const char *UPC_range[][2] = {
^~~~~~~~~

We could either revert the static-ification of these variables,
or move them into isn.c which seems to be the sole consumer.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2024-09-19 23:48:07 Re: pgsql: Convert some extern variables to static
Previous Message Bruce Momjian 2024-09-19 22:05:48 pgsql: doc PG relnotes: remove warning about commit links in PDF build