"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: Pointer sign warnings
To:
"Todd C. Miller" <millert@openbsd.org>
Cc:
Christian Weisgerber <naddy@mips.inka.de>, gameoftrees@openbsd.org
Date:
Tue, 28 Sep 2021 18:25:21 +0200

Download raw body.

Thread
On Tue, Sep 28, 2021 at 09:09:22AM -0600, Todd C. Miller wrote:
> On Tue, 28 Sep 2021 16:48:40 +0200, Christian Weisgerber wrote:
> 
> > How do we want to handle this?  Adapt the world to Got or vice versa?
> >
> > We could add -Wno-pointer-sign to -portable.  It's what I did for
> > my existing FreeBSD port.
> 
> That seems like the simplest approach.
> 
> > Alternatively, I could sit down and try to eliminate the warnings
> > by adjusting the type of buffer variables etc.  I guess that will
> > take a recursive approach: Start at the calls of external interfaces
> > (zlib...), then work up the call chain.  If we go down that route,
> > I suggest that we later add -Wpointer-sign to the development CFLAGS.
> 
> This seems like a lot of work for little gain.  I started to do
> this in OpenBSD and it quickly ballooned into a huge project, at
> which time I dropped it.

I'm also with fine silencing such warnings in -portable.

But I would not mind seeing type cleanup work being done if naddy really
wants to do it. Though it sounds like there are similar problems where
the return for time invested would be higher.

For example, I remember signedness of size_t integer comparisons being
another issue on FreeBSD and some patches were floated by FreeBSD
developers other than naddy.  Was that work ever fully completed?

We also have some size_t across the tree which should be off_t because
they represent file sizes (in some cases I chose size_t by mistake).
This is something I've been meaning to tidy up but haven't gotten around to.