Re: Use -fvisibility=hidden for shared libraries - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Use -fvisibility=hidden for shared libraries
Date
Msg-id 2767066.1641934459@sss.pgh.pa.us
Whole thread Raw
In response to Use -fvisibility=hidden for shared libraries  (Andres Freund <andres@anarazel.de>)
Responses Re: Use -fvisibility=hidden for shared libraries
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> What is bugging me is that I am fairly sure that my local compilers at some
> point complained about such mismatches on linux as well. But I can't reproduce
> that right now :/

> Now I wonder if I just saw it when cross compiling locally...

I still don't understand what are the conditions for MSVC to complain.
The rule is evidently not that every extern must agree with the function
definition, because for example you added

+extern PGDLLEXPORT void _PG_init(void);

in fmgr.h, but you didn't change any of the existing extern declarations
or definitions for _PG_init functions, and yet everything seems to work.

I had concluded that gcc/clang follow the rule "use an attribute if it
appears on at least one extern for the function", and this seems like
evidence that it works like that in MSVC too.

            regards, tom lane



pgsql-hackers by date:

Previous
From: "Bossart, Nathan"
Date:
Subject: Re: Add jsonlog log_destination for JSON server logs
Next
From: Justin Pryzby
Date:
Subject: Re: Column Filtering in Logical Replication