Re: simplehash.h: "SH_SCOPE static" causes warnings

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: simplehash.h: "SH_SCOPE static" causes warnings
Date: 2024-04-09 19:53:46
Message-ID: CA+TgmoaR7pg5qPNC_8dpgJ0aw41p85+L5w3eF-XCgALvf6kyDg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 9, 2024 at 3:30 PM Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> Pages of warnings is not ideal, though. We should either support
> "SH_SCOPE static", or have some kind of useful #error that makes it
> clear that we don't support it (and/or don't think it's a good idea).

Fair.

> > I'm not sure that I like the idea of just ignoring the
> > warnings, for fear that the compiler might not actually remove the
> > code for the unused functions from the resulting binary. But I'm not
> > an expert in this area either, so maybe I'm wrong.
>
> In a simple "hello world" test with an unreferenced static function, it
> doesn't seem to be a problem at -O2. I suppose it could be with some
> compiler somewhere, or perhaps in a more complex scenario, but it would
> seem strange to me.

OK.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-04-09 19:56:26 Re: simplehash.h: "SH_SCOPE static" causes warnings
Previous Message Alexander Korotkov 2024-04-09 19:47:37 Re: post-freeze damage control