pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Use -fvisibility=hidden for shared libraries
Date: Tue, 11 Jan 2022 15:54:19 -0500
Message-ID: <2767066.1641934459@sss.pgh.pa.us> (raw)
In-Reply-To: <20220111054252.oq5afaf5kxiojf7j@alap3.anarazel.de>
References: <20211101020311.av6hphdl6xbjbuif@alap3.anarazel.de>
	<b8103d16bf26cff7a393d1de690474dbd9afaa19.camel@cybertec.at>
	<20211101054700.z3jzmc5lnxlad4y7@alap3.anarazel.de>
	<2499085.1641859296@sss.pgh.pa.us>
	<20220111031107.GU14051@telsasoft.com>
	<20220111033133.k5cj63ywz64oxj4y@alap3.anarazel.de>
	<2533117.1641876246@sss.pgh.pa.us>
	<20220111054252.oq5afaf5kxiojf7j@alap3.anarazel.de>

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





view thread (23+ messages)  latest in thread

Message-ID: <2767066.1641934459@sss.pgh.pa.us>
Permalink:  ../2767066.1641934459@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2767066.1641934459@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, pryzby@telsasoft.com, laurenz.albe@cybertec.at
  Subject: Re: Use -fvisibility=hidden for shared libraries
  In-Reply-To: <2767066.1641934459@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox