DASH Shell discussions
 help / color / mirror / Atom feed
From: maximilian attems <max@stro.at>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: dash@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>, klibc@zytor.com
Subject: Re: (fwd) dash fix for job control off warning
Date: Fri, 2 Apr 2010 16:47:51 +0200	[thread overview]
Message-ID: <20100402144751.GA32211@baikonur.stro.at> (raw)
In-Reply-To: <20100402144220.GB31158@gondor.apana.org.au>

On Fri, Apr 02, 2010 at 10:42:20PM +0800, Herbert Xu wrote:
> On Fri, Apr 02, 2010 at 04:32:20PM +0200, maximilian attems wrote:
> >
> > Pulled this; there seems to be a problem with the new version of dash
> > with job control off.  I can't tell if it is just a warning or is a
> > manifest bug.
> > 
> > The solution is simple:
> > 
> > --- a/usr/dash/jobs.h
> > +++ b/usr/dash/jobs.h
> > @@ -105,5 +105,5 @@ int waitforjob(struct job *);
> >  int stoppedjobs(void);
> > 
> >  #if ! JOBS
> > -#define setjobctl(on)  /* do nothing */
> > +#define setjobctl(on) ((void)(on))     /* do nothing */
> >  #endif
> > 
> > ... to keep the code syntactically valid even when setjobctl() is used
> > as the body of an if statement.
> 
> So when exactly is this needed? Can you give an example?

usr/dash/trap.c: In function `exitshell':
usr/dash/trap.c:376: warning: suggest braces around empty body in an `if' statement

exitshell() has:

        /*
         * Disable job control so that whoever had the foreground before we
         * started can get it back.
         */
        if (likely(!setjmp(loc.loc)))
                setjobctl(0);


aboves patch fixes this gcc warning for me, but I still see:
  KLIBCCC usr/dash/trap.o
usr/dash/trap.c: In function ‘exitshell’:
usr/dash/trap.c:352: warning: variable ‘status’ might be clobbered by ‘longjmp’ or ‘vfork’


      reply	other threads:[~2010-04-02 14:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-02 14:32 (fwd) dash fix for job control off warning maximilian attems
2010-04-02 14:42 ` Herbert Xu
2010-04-02 14:47   ` maximilian attems [this message]

Reply instructions:

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

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

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100402144751.GA32211@baikonur.stro.at \
    --to=max@stro.at \
    --cc=dash@vger.kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=klibc@zytor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox