Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAH9TF6Nqd_+K5py1N3xqsmXesxXAABaGvjB5_RAa+1CfB2UrEg@mail.gmail.com>
Date: Tue, 25 Mar 2025 22:30:39 +0100
From: Alex Rønne Petersen <alex@...xrp.com>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: [PATCH] powerpc, powerpc64, s390x: remove unsigned suffix
 on SA_* macros

On Tue, Mar 25, 2025 at 10:20 PM Rich Felker <dalias@...c.org> wrote:
>
> On Mon, Mar 24, 2025 at 05:24:32PM +0100, Alex Rønne Petersen wrote:
> > I'm not really sure why this was ever here. It's not done for any other ports,
> > and AFAICT glibc doesn't do this either. It causes -Wsign-conversion warnings in
> > code that's completely fine, such as `act->sa_flags & SA_SIGINFO`.
> > ---
> >  arch/powerpc/bits/signal.h   | 16 ++++++++--------
> >  arch/powerpc64/bits/signal.h | 16 ++++++++--------
> >  arch/s390x/bits/signal.h     | 16 ++++++++--------
> >  3 files changed, 24 insertions(+), 24 deletions(-)
> >
> > diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h
> > index c1bf3caf..de1af5c5 100644
> > --- a/arch/powerpc/bits/signal.h
> > +++ b/arch/powerpc/bits/signal.h
> > @@ -70,14 +70,14 @@ typedef struct __ucontext {
> >       mcontext_t uc_mcontext;
> >  } ucontext_t;
> >
> > -#define SA_NOCLDSTOP  1U
> > -#define SA_NOCLDWAIT  2U
> > -#define SA_SIGINFO    4U
> > -#define SA_ONSTACK    0x08000000U
> > -#define SA_RESTART    0x10000000U
> > -#define SA_NODEFER    0x40000000U
> > -#define SA_RESETHAND  0x80000000U
> > -#define SA_RESTORER   0x04000000U
> > +#define SA_NOCLDSTOP  1
> > +#define SA_NOCLDWAIT  2
> > +#define SA_SIGINFO    4
> > +#define SA_ONSTACK    0x08000000
> > +#define SA_RESTART    0x10000000
> > +#define SA_NODEFER    0x40000000
> > +#define SA_RESETHAND  0x80000000
> > +#define SA_RESTORER   0x04000000
>
> Unfortunately this seems to leave the signedness inconsistent:
> SA_RESETHAND is still unsigned. Should that be fixed too by defining
> it as a negative value? That might be the motivation for why they were
> all made unsigned on ppc originally...

FWIW, save for a few odd-duck ports (alpha, hppa, sparc), glibc seems
content to define SA_RESETHAND as 0x80000000.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.