From owner-freebsd-bugs@FreeBSD.ORG Sun Jun 8 03:30:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F237F106564A for ; Sun, 8 Jun 2008 03:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DE1908FC15 for ; Sun, 8 Jun 2008 03:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m583U1WG011399 for ; Sun, 8 Jun 2008 03:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m583U1nk011397; Sun, 8 Jun 2008 03:30:01 GMT (envelope-from gnats) Resent-Date: Sun, 8 Jun 2008 03:30:01 GMT Resent-Message-Id: <200806080330.m583U1nk011397@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E53D71065670 for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/124385: usr.sbin/ngctl/main.c fails to compile under -CURRENT with default warning commentary and custom CFLAGs X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2008 03:30:02 -0000 >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@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: >Unformatted: