The following reply was made to PR user/6494; it has been noted by GNATS.

From: Jason McIntyre <[email protected]>
To: [email protected]
Cc:  
Subject: Re: user/6494: make -q exits with -1
Date: Fri, 22 Oct 2010 19:50:34 +0100

 On Wed, Oct 20, 2010 at 02:59:00PM +0200, [email protected] wrote:
 > >Number:         6494
 > >Category:       user
 > >Synopsis:       make(1) man page states -q exits with 1 or 0, but -1 is 
 > >also possible
 > >Confidential:   yes
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    bugs
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   unknown
 > >Arrival-Date:   Wed Oct 20 13:10:01 GMT 2010
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     
 > >Release:        
 > >Organization:
 > >Environment:
 >      System      : OpenBSD 4.5
 >      Details     : OpenBSD 4.5-stable (GENERIC.MP) #1: Thu Oct 29 09:22:18 
 > CET 2009
 >                       
 > [email protected]:/usr/src/sys/arch/i386/compile/GENERIC.MP
 > 
 >      Architecture: OpenBSD.i386
 >      Machine     : i386
 > >Description:
 >      The make(1) man page states that when -q is used, it should exit with
 > either 1 or 0.  But, when running `make -q` on various parts of OpenBSD, 
 > I've 
 > observed that `echo $?` almost always results in 255.  I believe this might 
 > be 
 > due to the sequence
 >              if (queryFlag)
 >                      exit(-1);
 > in src/usr.bin/make/compat.c .
 > 
 > >How-To-Repeat:
 >      cd /usr/src/bin/cat; make clean > /dev/null
 >      make -q; echo $?
 >      make > /dev/null
 >      make -q; echo $?
 > and observe how in both cases (not built and built,) 255 is printed.
 > >Fix:
 >      Not known.
 > 
 
 the man page is in line with what posix specifies, so i'm going to go
 out on a limb and say the code is wrong. specifically, -q is supposed to
 return 1, not -1, if the target file is not up to date. so i'd further
 say we should expect it to "exit(1)", not -1.
 
 i checked netbsd source, and they return 1, not -1. freebsd have no
 compat.c file. i don;t have net/free source trees to dig any further.
 anyone want to fix this, or have another solution?
 
 jmc

Reply via email to