Declaration fixes

Started by Andres Freundalmost 4 years ago4 messageshackers
Jump to latest
#1Andres Freund
andres@anarazel.de

Hi,

I was experimenting with specifying symbol visiblity for functions explicitly,
i.e. adding PGDLLIMPORT markers for them, with the goal of getting rid of
src/tools/msvc/gendef.pl (and similar AIX stuff). While doing that I compared
the set of exported symbols before / after, leading me to find a few
pre-existing "issues".

I think the attached patches are all a good idea and trivial enought that I
think we should apply them now.

The changes are sufficiently obvious and/or explained in the commit messages.

Comments?

Greetings,

Andres Freund

Attachments:

v1-0001-Add-missing-extern-to-function-prototypes.patchtext/x-diff; charset=us-asciiDownload+69-70
v1-0002-Add-static-to-file-local-variables-missing-it.patchtext/x-diff; charset=us-asciiDownload+12-14
v1-0003-Add-missing-binary_upgrade.h-where-includes.patchtext/x-diff; charset=us-asciiDownload+2-1
v1-0004-Remove-function-declaration-for-function-in-pg_pr.patchtext/x-diff; charset=us-asciiDownload+1-3
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#1)
Re: Declaration fixes

Andres Freund <andres@anarazel.de> writes:

I was experimenting with specifying symbol visiblity for functions explicitly,
i.e. adding PGDLLIMPORT markers for them, with the goal of getting rid of
src/tools/msvc/gendef.pl (and similar AIX stuff). While doing that I compared
the set of exported symbols before / after, leading me to find a few
pre-existing "issues".

I think the attached patches are all a good idea and trivial enought that I
think we should apply them now.

+1 to all of that. Would the changes you're working on result in getting
warnings for these sorts of oversights on mainstream compilers?

regards, tom lane

#3Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#2)
Re: Declaration fixes

Hi,

On 2022-05-12 13:18:05 -0400, Tom Lane wrote:

Andres Freund <andres@anarazel.de> writes:

I was experimenting with specifying symbol visiblity for functions explicitly,
i.e. adding PGDLLIMPORT markers for them, with the goal of getting rid of
src/tools/msvc/gendef.pl (and similar AIX stuff). While doing that I compared
the set of exported symbols before / after, leading me to find a few
pre-existing "issues".

I think the attached patches are all a good idea and trivial enought that I
think we should apply them now.

+1 to all of that.

Cool.

Would the changes you're working on result in getting
warnings for these sorts of oversights on mainstream compilers?

I assume with "mainstream compiler" you basically mean gcc and clang? If so,
some oversights would be hard errors, some warnings, some runtime (i.e. symbol
not found errors when loading extension library) but some others unfortunately
would continue to only be visible in msvc :(.

Greetings,

Andres Freund

#4Andres Freund
andres@anarazel.de
In reply to: Andres Freund (#3)
Re: Declaration fixes

On 2022-05-12 11:38:39 -0700, Andres Freund wrote:

On 2022-05-12 13:18:05 -0400, Tom Lane wrote:

Andres Freund <andres@anarazel.de> writes:

I think the attached patches are all a good idea and trivial enought that I
think we should apply them now.

+1 to all of that.

Cool.

Pushed them.