misc/124385: usr.sbin/ngctl/main.c fails to compile under -CURRENT with default warning commentary and custom CFLAGs

Garrett Cooper gcooper at FreeBSD.org
Sun Jun 8 03:30:02 UTC 2008


>Number:         124385
>Category:       misc
>Synopsis:       usr.sbin/ngctl/main.c fails to compile under -CURRENT with default warning commentary and custom CFLAGs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 08 03:30:01 UTC 2008
>Closed-Date:
>Last-Modified:
>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 at optimus:/usr/obj/usr/src/sys/OPTIMUS  i386
>Description:
[root at 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:
>Unformatted:


More information about the freebsd-bugs mailing list