DASH Shell discussions
 help / color / mirror / Atom feed
* (fwd) dash fix for job control off warning
@ 2010-04-02 14:32 maximilian attems
  2010-04-02 14:42 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: maximilian attems @ 2010-04-02 14:32 UTC (permalink / raw)
  To: dash; +Cc: H. Peter Anvin, Herbert Xu, klibc

----- Forwarded message from "H. Peter Anvin" <hpa@zytor.com> -----

Date: Mon, 29 Mar 2010 15:07:01 -0700
From: "H. Peter Anvin" <hpa@zytor.com>
To: maximilian attems <max@stro.at>
Cc: Colin Watson <cjwatson@ubuntu.com>, klibc@zytor.com,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Subject: Re: [klibc] [git pull v3] dash, sh4, ipconfig, dprintf, fstype,
	README's

On 03/27/2010 05:58 PM, maximilian attems wrote:
> hello hpa!
> 
> added on top of queue ext4 fix, that Ubuntu is carrying from cjwatson.
> Got missed out in previous pull requests. Btrfs recognition in fstype.
> 
> the patch queue contains sync with latest dash, sh4 fix by Debian porters,
> dprintf usage in ipconfig, kinit and nfsmount instead of buggy DEBUG
> macro. ipconfig memcpy usage to avoid strict aliasing warnings.
> Some interesting README's got renamed for easier packaging.
> Bonus is sparc32 socket test.
> 

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.

	-hpa

----- End forwarded message -----
-- 
maks

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: (fwd) dash fix for job control off warning
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2010-04-02 14:42 UTC (permalink / raw)
  To: maximilian attems; +Cc: dash, H. Peter Anvin, klibc

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?

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: (fwd) dash fix for job control off warning
  2010-04-02 14:42 ` Herbert Xu
@ 2010-04-02 14:47   ` maximilian attems
  0 siblings, 0 replies; 3+ messages in thread
From: maximilian attems @ 2010-04-02 14:47 UTC (permalink / raw)
  To: Herbert Xu; +Cc: dash, H. Peter Anvin, klibc

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’


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-02 14:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox