Re: small patch for pty.c

From: willy@thepuffingroup.com
Date: Wed Apr 19 2000 - 04:27:29 EST


On Wed, Apr 19, 2000 at 09:41:00AM +0200, Kai Henningsen wrote:
> willy@thepuffingroup.com wrote on 18.04.00 in <20000418122749.W15697@thepuffingroup.com>:
>
> > On Tue, Apr 18, 2000 at 12:48:53PM +0200, Jamie Lokier wrote:
> > > GCC -Wall warns about comparisons between signed and unsigned.
> > > Is that not good enough?
> > the header files need to be cleaned up in order to be able to use -Wall
> > without getting scads of bogus warnings.
> I thought the kernel *is* compiled with -Wall, and has been for a long
> time? And I certainly don't remember scads of bogus warnings from kernel
> compiles. (Incidentally, the same is true for my userland compiles.)

oops. jamie's fault initially, compounded by me. he meant -W and so did I.
sorry.

> >Some of that work has been
> > done but not all of it. I'll get to it sometime if no-one beats me to it.
> > (hint, it's the signal delivery stuff).
>
> More details, please.

include/linux/signal.h has constructs which are intended to be optimised
out, but nevertheless generate piles of warnings while the macro
_SIG_SET_BINOP is evaluated. It's overly general in fact. Here's a
simpler, completely untested, version which covers all cases currently
present in the kernel and should be easy to extend to any future required
case:

#define _SIG_SET_BINOP(name, op) \
extern inline void name(sigset_t *r, const sigset_t *a, const sigset_t *b) \
{ \
        unsigned long a_, b_; \
                                                        \
        switch (_NSIG_WORDS) { \
            case 4: \
                a_ = a->sig[3]; b_ = b->sig[3]; \
                r->sig[3] = op(a_, b_); \
                a_ = a->sig[2]; b_ = b->sig[2]; \
                r->sig[2] = op(a_, b_); \
            case 2: \
                a_ = a->sig[1]; b_ = b->sig[1]; \
                r->sig[1] = op(a_, b_); \
            case 1: \
                a_ = a->sig[0]; b_ = b->sig[0]; \
                r->sig[0] = op(a_, b_); \
        } \
}

it might well generate worse code than the previous version, i haven't
even compiled it.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:14 EST