Re: depcomp bug (was [Fwd: CVS update: ccvs])
> "Hair" == Raja R Harinath <[EMAIL PROTECTED]> writes: Hair> from Raja R Harinath <[EMAIL PROTECTED]> Hair> * depcomp (gcc3): Invert test condition. Oops, thanks. Tom
Re: depcomp bug (was [Fwd: CVS update: ccvs])
Tom Tromey writes: > > Larry, can you try the new depcomp to see if it works? Yes, it works fine. Thanks. -Larry Jones What's Santa's definition? How good do you have to be to qualify as good? -- Calvin
Re: depcomp bug (was [Fwd: CVS update: ccvs])
Hi, Tom Tromey <[EMAIL PROTECTED]> writes: > > "Derek" == Derek R Price <[EMAIL PROTECTED]> writes: > Derek> One of the other CVS developers reported a bug in depcomp on > Derek> BSD/OS. Apparently the included /bin/sh doesn't set $? inside > Derek> of the conditional. His original message and fix are attached. > > I checked in a variant of this patch. > depcomp has changed since the patch was made. > > Larry, can you try the new depcomp to see if it works? > I can email it to you if you like. The 'gcc3' code looks somewhat suspect :-) I think it's preferable to use less obtuse code. The rest of the file uses if test "$stat" != "0"; then exit $stat; fi So, the cases fixed above should use code like ... if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi ... Anyway, here's a fix for the one problem. from Raja R Harinath <[EMAIL PROTECTED]> * depcomp (gcc3): Invert test condition. Index: depcomp === RCS file: /cvs/automake/automake/depcomp,v retrieving revision 1.20 diff -u -p -u -r1.20 depcomp --- depcomp 2001/04/07 20:22:07 1.20 +++ depcomp 2001/04/07 20:49:36 @@ -53,7 +53,7 @@ gcc3) ## we want. Yay! "$@" -MT "$object" -MF "$tmpdepfile" -MD -MP stat=$? - if test $stat -ne 0; then : + if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat - Hari -- Raja R Harinath -- [EMAIL PROTECTED] "When all else fails, read the instructions." -- Cahn's Axiom "Our policy is, when in doubt, do the right thing." -- Roy L Ash
Re: depcomp bug (was [Fwd: CVS update: ccvs])
> "Derek" == Derek R Price <[EMAIL PROTECTED]> writes: Derek> One of the other CVS developers reported a bug in depcomp on Derek> BSD/OS. Apparently the included /bin/sh doesn't set $? inside Derek> of the conditional. His original message and fix are attached. I checked in a variant of this patch. depcomp has changed since the patch was made. Larry, can you try the new depcomp to see if it works? I can email it to you if you like. Tom
Re: depcomp bug (was [Fwd: CVS update: ccvs])
> "Derek" == Derek R Price <[EMAIL PROTECTED]> writes: Derek> One of the other CVS developers reported a bug in depcomp on Derek> BSD/OS. Apparently the included /bin/sh doesn't set $? inside Derek> of the conditional. His original message and fix are attached. Thanks. This looks good to me. I'll check it in when I get a chance (unless someone beats me to it). Tom
depcomp bug (was [Fwd: CVS update: ccvs])
Hey folks! One of the other CVS developers reported a bug in depcomp on BSD/OS. Apparently the included /bin/sh doesn't set $? inside of the conditional. His original message and fix are attached. Derek -- Derek Price CVS Solutions Architect ( http://CVSHome.org ) mailto:[EMAIL PROTECTED] CollabNet ( http://collab.net ) -- Boy: A noise with dirt on it Derek R. Price writes: > > * depcomp: Don't count on $? being set in then or else clauses. > > What system is this happening on? depcomp is part of the Automake > distribution. Boy, that was fast! I was going to send you a message suggesting that you pass that change on to the Automake folks, but you beat me to it. It happens on my BSD/OS system with bin/sh (but not with bash or ksh). Looking at the SUS-2 specs for sh: http://www.opengroup.org/onlinepubs/7908799/xcu/chap2.html I don't see any requirement that the exit status of the conditional be available in $? in the then and else clauses and given one counter example and the fact that it's easy enough to work around, it seems like the prudent thing to do. -Larry Jones He's just jealous because I accomplish so much more than he does. -- Calvin Index: depcomp === RCS file: /home2/cvsroot/ccvs/depcomp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- depcomp 2000/12/21 22:14:19 1.1 +++ depcomp 2001/04/04 18:21:01 1.2 @@ -61,9 +61,9 @@ if test -z "$gccflag"; then gccflag=-MD, fi - if "$@" -Wp,"$gccflag$tmpdepfile"; then : - else -stat=$? + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat != 0; then rm -f "$tmpdepfile" exit $stat fi @@ -102,9 +102,9 @@ # trick. Instead we must use -M and then rename the resulting .d # file. This is also the case for older versions of gcc, which # don't implement -Wp. - if "$@" -MD; then : - else -stat=$? + "$@" -MD + stat=$? + if test $stat != 0; then rm -f FIXME exit $stat fi @@ -118,9 +118,7 @@ "$@" -MDupdate "$tmpdepfile" fi stat=$? - if test $stat -eq 0; then : - else -stat=$? + if test $stat != 0; then rm -f "$tmpdepfile" exit $stat fi