Skip to contentSkip to conversation

(fwd) dash fix for job control off warning

PATCH maximilian attems 2 participants 3 messages Apr 2, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

----- Forwarded message from "H. Peter Anvin" <[email protected]> -----

Date: Mon, 29 Mar 2010 15:07:01 -0700
From: "H. Peter Anvin" <[email protected]>
To: maximilian attems <[email protected]>
Cc: Colin Watson <[email protected]>, [email protected],
Herbert Xu <[email protected]>,
Nobuhiro Iwamatsu <[email protected]>
Subject: Re: [klibc] [git pull v3] dash, sh4, ipconfig, dprintf, fstype,
README's

Quoted 11 lines · maximilian attems

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:

usr/dash/jobs.h +1 -1
@@ -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 -----

Signature · 1 line
maks
#1 lore raw
Quoted 17 lines · maximilian attems

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:

usr/dash/jobs.h +1 -1
@@ -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
Quoted 2 lines

... 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,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#2 lore raw
Quoted 18 lines · Herbert Xu
Quoted 17 lines · maximilian attems

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:

usr/dash/jobs.h +1 -1
@@ -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
Quoted 4 lines
Quoted 2 lines

... 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’