From rmh@khazad.dyndns.org  Sat Dec 18 01:33:20 2004
Return-Path: <rmh@khazad.dyndns.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 029B216A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Dec 2004 01:33:19 +0000 (GMT)
Received: from khazad.dyndns.org (5.red-62-57-140.user.auna.net [62.57.140.5])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8FA9D43D4C
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Dec 2004 01:33:18 +0000 (GMT)
	(envelope-from rmh@khazad.dyndns.org)
Received: from rmh by khazad.dyndns.org with local (Exim 4.34)
	id 1CfTOo-0001U7-1a
	for FreeBSD-gnats-submit@freebsd.org; Sat, 18 Dec 2004 02:28:46 +0100
Message-Id: <E1CfTOo-0001U7-1a@khazad.dyndns.org>
Date: Sat, 18 Dec 2004 02:28:46 +0100
From: Robert Millan <rmh@debian.org>
Reply-To: Robert Millan <rmh@debian.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: make fails to build with gcc-4.0
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         75210
>Category:       bin
>Synopsis:       make fails to build with gcc-4.0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    harti
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 18 01:40:21 GMT 2004
>Closed-Date:    Mon Dec 20 10:15:27 GMT 2004
>Last-Modified:  Mon Jan  3 12:50:24 GMT 2005
>Originator:     Robert Millan
>Release:        GNU/kFreeBSD 5.3-2 i386
>Organization:
Debian
>Environment:
System: GNU/kFreeBSD aragorn 5.3-2 #0: Thu Dec 2 01:55:37 CET 2004 i386 GNU/KFreeBSD


	
>Description:
	I'm forwarding this report Andreas Jochens sent to Debian BTS
	(bugs #285953 and #285954).  Quoting him:

When building 'freebsd5-buildutils' on amd64 with gcc-4.0,
I get the following error:

cc -O -I/freebsd5-buildutils-5.3/build-tree/src/usr.bin/make -DMAKE_VERSION=\"5200408120\" -DDEFSHELL=1 -O2 -g -Wall -DMACHINE_ARCH='"x86_64"'   -c job.c
job.c:231: error: static declaration of 'maxJobs' follows non-static declaration
job.h:229: error: previous declaration of 'maxJobs' was here
*** Error code 1

Stop.
pmake: stopped in /freebsd5-buildutils-5.3/build-tree/src/usr.bin/make
make: *** [build/freebsd5-buildutils] Error 1

With the attached patch 'freebsd5-buildutils' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

>How-To-Repeat:
	
>Fix:

diff -urN tmp/usr.bin/make/job.c src/usr.bin/make/job.c
--- tmp/usr.bin/make/job.c	2004-12-16 17:06:50.255866000 +0100
+++ src/usr.bin/make/job.c	2004-12-16 17:08:49.266774208 +0100
@@ -228,7 +228,7 @@
                	*shellName = NULL;		  /* last component of shell */
 
 
-static int  	maxJobs;    	/* The most children we can run at once */
+int  	maxJobs;    	/* The most children we can run at once */
 static int  	maxLocal;    	/* The most local ones we can have */
 STATIC int     	nJobs;	    	/* The number of children currently running */
 STATIC int	nLocal;    	/* The number of local children */
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->harti 
Responsible-Changed-By: simon 
Responsible-Changed-When: Sat Dec 18 12:01:45 GMT 2004 
Responsible-Changed-Why:  
Harti has been doing a lot of work on make, so perhaps he is 
interested in this? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75210 
State-Changed-From-To: open->closed 
State-Changed-By: harti 
State-Changed-When: Mon Dec 20 10:14:49 GMT 2004 
State-Changed-Why:  
Patch committed.  Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75210 

From: Robert Watson <rwatson@FreeBSD.org>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: misc/75210: make fails to build with gcc-4.0
Date: Mon, 3 Jan 2005 12:37:38 +0000 (GMT)

 On Sat, 18 Dec 2004, Robert Millan wrote:
 
 > diff -urN tmp/usr.bin/make/job.c src/usr.bin/make/job.c
 > --- tmp/usr.bin/make/job.c	2004-12-16 17:06:50.255866000 +0100
 > +++ src/usr.bin/make/job.c	2004-12-16 17:08:49.266774208 +0100
 > @@ -228,7 +228,7 @@
 >                 	*shellName = NULL;		  /* last component of shell */
 >  
 >  
 > -static int  	maxJobs;    	/* The most children we can run at once */
 > +int  	maxJobs;    	/* The most children we can run at once */
 >  static int  	maxLocal;    	/* The most local ones we can have */
 >  STATIC int     	nJobs;	    	/* The number of children currently running */
 >  STATIC int	nLocal;    	/* The number of local children */
 
 This may not be the correct fix: there are in fact two different "maxJobs" 
 variables, one scoped to main.c, the other from job.c.  The value in job.c
 is derived from the argument to Job_Init().  I would recommend an
 alternative fix of renaming the maxJobs variable in main.c to some other
 name. 
 
 Robert N M Watson
 
>Unformatted:
