From nobody@FreeBSD.org  Sun Jun  8 03:29:12 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 E53D71065670
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  8 Jun 2008 03:29:12 +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 E35FB8FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  8 Jun 2008 03:29:12 +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 m583TCns040504
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 8 Jun 2008 03:29:12 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m583TC67040503;
	Sun, 8 Jun 2008 03:29:12 GMT
	(envelope-from nobody)
Message-Id: <200806080329.m583TC67040503@www.freebsd.org>
Date: Sun, 8 Jun 2008 03:29:12 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: usr.sbin/ngctl/main.c fails to compile under -CURRENT with default warning commentary and custom CFLAGs 
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         124385
>Category:       misc
>Synopsis:       [build] [patch] usr.sbin/ngctl/main.c fails to compile under -CURRENT with default warning commentary 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:   Sun Jun 08 03:30:01 UTC 2008
>Closed-Date:    Fri Mar 15 23:34:52 UTC 2013
>Last-Modified:  Fri Mar 15 23:34:52 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:
[root@optimus /devel/ncvs/src/usr.sbin/ngctl]# grep -E 'CFLAGS|TYPE' /etc/make.conf
CFLAGS=-O3 -pipe -fno-strict-aliasing
CPUTYPE=prescott
>How-To-Repeat:
1. Checkout sources using either CVS or csup.
2. make buildworld (with above CFLAGS / CPUTYPE)
>Fix:
This is a questionable patch... not sure if DoParseCommand and calling input variable should be replaced with (const char*) items. I don't use netgraph either, so I can't test this.

Patch attached with submission follows:

Index: main.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/ngctl/main.c,v
retrieving revision 1.23
diff -r1.23 main.c
72c72
< static int	DoParseCommand(char *line);
---
> static int	DoParseCommand(const char *line);
217c217
< 		if ((rtn = DoParseCommand(line)) != 0) {
---
> 		if ((rtn = DoParseCommand((const char*) line)) != 0) {
318c318
< 		if ((buf = el_gets(el, &count)) == NULL) {
---
> 		if ((buf = (char*) el_gets(el, &count)) == NULL) {
325c325
< 		if (DoParseCommand((char *)buf) == CMDRTN_QUIT)
---
> 		if (DoParseCommand(buf) == CMDRTN_QUIT)
385c385
< 			if (DoParseCommand(buf) == CMDRTN_QUIT)
---
> 			if (DoParseCommand((const char*) buf) == CMDRTN_QUIT)
426c426
< DoParseCommand(char *line)
---
> DoParseCommand(const char *line)
432c432
< 	for (ac = 0, av[0] = strtok(line, WHITESPACE);
---
> 	for (ac = 0, av[0] = strtok((char*)line, WHITESPACE);


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: mtm 
State-Changed-When: Sat Jun 28 12:31:44 UTC 2008 
State-Changed-Why:  
Committed to head in r180076. Take the PR so I don't forget to MFC it. 


Responsible-Changed-From-To: freebsd-bugs->mtm 
Responsible-Changed-By: mtm 
Responsible-Changed-When: Sat Jun 28 12:31:44 UTC 2008 
Responsible-Changed-Why:  
Committed to head in r180076. Take the PR so I don't forget to MFC it. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/124385: commit references a PR
Date: Sat, 28 Jun 2008 12:31:45 +0000 (UTC)

 mtm         2008-06-28 12:31:30 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.sbin/ngctl       main.c 
   Log:
   SVN rev 180076 on 2008-06-28 12:31:30Z by mtm
   
   Modify the DoParseCommand() to work on (const char *) instead of just
   (char *). This is a slightly simplified version of the patch in the PR. It
   fixes compilitation issues with -O3.
   
   PR: misc/124385
   
   Revision  Changes    Path
   1.24      +4 -4      src/usr.sbin/ngctl/main.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: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Fri Mar 15 23:34:52 UTC 2013 
State-Changed-Why:  
MFCed/fixed by now or it will never be MFCed 

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