From owner-freebsd-bugs@FreeBSD.ORG Sun Aug 30 15:40:02 2009 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 A2A071065672 for ; Sun, 30 Aug 2009 15:40:02 +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 7FE3C8FC23 for ; Sun, 30 Aug 2009 15:40:02 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7UFe2vM029400 for ; Sun, 30 Aug 2009 15:40:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7UFe2sL029399; Sun, 30 Aug 2009 15:40:02 GMT (envelope-from gnats) Resent-Date: Sun, 30 Aug 2009 15:40:02 GMT Resent-Message-Id: <200908301540.n7UFe2sL029399@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, "System V. Unix" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE5E2106566B for ; Sun, 30 Aug 2009 15:35:17 +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 A3DB38FC14 for ; Sun, 30 Aug 2009 15:35:17 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n7UFZH3t093590 for ; Sun, 30 Aug 2009 15:35:17 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n7UFZHNQ093589; Sun, 30 Aug 2009 15:35:17 GMT (envelope-from nobody) Message-Id: <200908301535.n7UFZHNQ093589@www.freebsd.org> Date: Sun, 30 Aug 2009 15:35:17 GMT From: "System V. Unix" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/138350: UFS_EXTATTR static int prototyping error ufs_extattr_autostart_locked 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, 30 Aug 2009 15:40:02 -0000 >Number: 138350 >Category: kern >Synopsis: UFS_EXTATTR static int prototyping error ufs_extattr_autostart_locked >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Aug 30 15:40:02 UTC 2009 >Closed-Date: >Last-Modified: >Originator: System V. Unix >Release: 7.2-RELEASE >Organization: >Environment: >Description: Using additional kernel option UFS_EXTATTR in 7.2-RELEASE causes a kernel build failure cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I../../.. -I../../../contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Werror ../../../ufs/ufs/ufs_extattr.c cc1: warnings being treated as errors ./../../ufs/ufs/ufs_extattr.c:97: warning: 'ufs_extattr_autostart_locked' declared 'static' but never defined *** Error code 1 This is because the routine is getting optionally defined around line 215 with a #ifdef UFS_EXTATTR_AUTOSTART, but the prototype is missing the analoguous #ifdef, and the compiler seems to be picky. >How-To-Repeat: Add option UFS_EXTATTR to the 7.2-RELEASE kernel and do a build. The problem was NOT seen in 7.1-RELEASE. >Fix: Trivial solution. Simply the add the pre-process directives around the prototyping of the subroutine at the head of the file. The routine lower down in ufs_extattr.c already has the #ifdefs around it. #ifdef UFS_EXTATTR_AUTOSTART #endif /* !UFS_EXTATTR_AUTOSTART */ That way BOTH the prototype and the subroutine have that #ifdef. e.g. ------------- diff -u usr/src/sys/ufs/ufs/ufs_extattr.c.orig usr/src/sys/ufs/ufs/ufs_extattr.c --- usr/src/sys/ufs/ufs/ufs_extattr.c.orig 2009-08-30 16:57:35.000000000 -0600 +++ usr/src/sys/ufs/ufs/ufs_extattr.c 2009-08-30 17:26:46.000000000 -0600 @@ -93,8 +93,10 @@ struct thread *td); static int ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, struct ucred *cred, struct thread *td); +#ifdef UFS_EXTATTR_AUTOSTART static int ufs_extattr_autostart_locked(struct mount *mp, struct thread *td); +#endif /* !UFS_EXTATTR_AUTOSTART */ static int ufs_extattr_start_locked(struct ufsmount *ump, struct thread *td); >Release-Note: >Audit-Trail: >Unformatted: