From nobody@FreeBSD.org  Fri Jun  6 06:08:16 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 28E6B106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  6 Jun 2008 06:08:16 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 0D1B08FC18
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  6 Jun 2008 06:08:16 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m5668Aas019317
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 6 Jun 2008 06:08:15 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m5668AmP019316;
	Fri, 6 Jun 2008 06:08:10 GMT
	(envelope-from nobody)
Message-Id: <200806060608.m5668AmP019316@www.freebsd.org>
Date: Fri, 6 Jun 2008 06:08:10 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: sbin/ggate/ggated/ggated.c fails to compile under -CURRENT with default warning settings and custom CFLAGs
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         124342
>Category:       bin
>Synopsis:       ggated(8): [patch] sbin/ggate/ggated/ggated.c fails to compile under -CURRENT with default warning settings and custom CFLAGs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mtm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 06 06:10:04 UTC 2008
>Closed-Date:    Fri Jul 29 09:13:18 UTC 2011
>Last-Modified:  Sun Feb 03 22:27:39 UTC 2013
>Originator:     Garrett Cooper
>Release:        8-CURRENT
>Organization:
n/a
>Environment:
FreeBSD optimus 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Mon May 19 02:21:07 PDT 2008     root@optimus:/usr/obj/usr/src/sys/OPTIMUS  i386
>Description:
ggated fails to compile with the following error:

/devel/ncvs/src/sbin/ggate/ggated/ggated.c: In function 'disk_thread':
/devel/ncvs/src/sbin/ggate/ggated/ggated.c:759: warning: no return statement in function returning non-void
/devel/ncvs/src/sbin/ggate/ggated/ggated.c: In function 'send_thread':
/devel/ncvs/src/sbin/ggate/ggated/ggated.c:813: warning: no return statement in function returning non-void

[gcooper@optimus ~]$ grep -E 'CFLAGS|CPUTYPE' /etc/make.conf
CFLAGS=-O3 -pipe -fno-strict-aliasing
CPUTYPE=prescott
>How-To-Repeat:
1. Checkout srcs from cvs.
2. cd .../src/sbin/ggate/ggated && make all 
>Fix:
A proposed patch is attached (simple, I know), and I've attached some comments for the author / maintainer of ggate.

I'd like to make sure that a return value of (void*) NULL is appropriate though, in both cases where return values were required...

Patch attached with submission follows:

Index: sbin/ggate/ggated/ggated.c
===================================================================
RCS file: /home/ncvs/src/sbin/ggate/ggated/ggated.c,v
retrieving revision 1.9
diff -r1.9 ggated.c
105a106,108
> /*
>  * XXX: See comment in connection_launch(..).
>  */
106a110,112
> /*
>  * XXX: See comment in bottom of function. 
>  */
579a586,593
> 
> 	/**
> 	 * XXX: Does disk thread really need a return value if it's just
> 	 * tossed here (or is this future work to make into a pthread_create(3)
> 	 * call?)
> 	 *
> 	 * (gcooper)
> 	 */
580a595
> 
682a698,700
> /*
>  * XXX: See comment in connection_launch(..)
>  */
758a777,779
> 
> 	return (void*) NULL;
> 
812a834,843
> 
> 	/**
> 	 * XXX: Is this a correct return value?
> 	 * According to the prototype and the
> 	 * definition above this _must_ have a
> 	 * return value...
> 	 * (gcooper)
> 	 **/
> 	return (void*) NULL;
> 


>Release-Note:
>Audit-Trail:

From: "Garrett Cooper" <yanefbsd@gmail.com>
To: "Garrett Cooper" <gcooper@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: misc/124342: sbin/ggate/ggated/ggated.c fails to compile under -CURRENT with default warning settings and custom CFLAGs
Date: Thu, 5 Jun 2008 23:24:31 -0700

 ------=_Part_6817_17222603.1212733471916
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 On Thu, Jun 5, 2008 at 11:08 PM, Garrett Cooper <yaneurabeya@gmail.com> wrote:
 
 Could you guys please change the severity from non-critical to serious and
 the priority from low to medium please?
 Thanks,
 -Garrett
 
 ------=_Part_6817_17222603.1212733471916--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/124342: commit references a PR
Date: Thu, 26 Jun 2008 07:05:53 +0000 (UTC)

 mtm         2008-06-26 07:05:35 UTC
 
   FreeBSD src repository
 
   Modified files:
     sbin/ggate/ggated    ggated.c 
   Log:
   SVN rev 180020 on 2008-06-26 07:05:35Z by mtm
   
   The signature for a pthread function requires that it
   return a pointer to a void. The send_thread() and disk_thread()
   funtions; however, do not have a return value because they run for
   the duration of the daemon's lifetime. This causes gcc to barf when
   running with -O3. Make these functions return a null pointer to quiet it.
   
   PR:     bin/124342
   Submitted by:   Garrett Cooper <yaneurabeya@gmail.com> (minus his comments)
   MFC after:      1 week
   
   Revision  Changes    Path
   1.11      +6 -0      src/sbin/ggate/ggated/ggated.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: mtm 
State-Changed-When: Fri Jun 27 09:31:45 UTC 2008 
State-Changed-Why:  
Patched in head  in r180020. Take the PR so I don't forget to MFC. 


Responsible-Changed-From-To: freebsd-bugs->mtm 
Responsible-Changed-By: mtm 
Responsible-Changed-When: Fri Jun 27 09:31:45 UTC 2008 
Responsible-Changed-Why:  
Patched in head  in r180020. Take the PR so I don't forget to MFC. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=124342 
State-Changed-From-To: patched->closed 
State-Changed-By: maxim 
State-Changed-When: Fri Jul 29 09:11:15 UTC 2011 
State-Changed-Why:  
The PR that is in the patched state for three years 
already deserves to be closed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=124342 
>Unformatted:
