From owner-freebsd-arch@FreeBSD.ORG Fri Dec 30 13:06:50 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D70E1065672; Fri, 30 Dec 2011 13:06:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 092498FC13; Fri, 30 Dec 2011 13:06:50 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:408b:3bdd:8466:f24f] (unknown [IPv6:2001:7b8:3a7:0:408b:3bdd:8466:f24f]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 48BF75C37; Fri, 30 Dec 2011 14:06:49 +0100 (CET) Message-ID: <4EFDB76C.1030901@FreeBSD.org> Date: Fri, 30 Dec 2011 14:06:52 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Alexander Best References: <20111226101040.GA6361@freebsd.org> In-Reply-To: <20111226101040.GA6361@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-toolchain@freebsd.org, current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [rfc] removing/conditionalising WERROR= in Makefiles X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2011 13:06:50 -0000 On 2011-12-26 11:10, Alexander Best wrote: > that's why i'd like to propose the following patch. i ran a full tinderbox run > against r228878 and it suceeded. Did you also try this with clang? For example the xfs module alone gets a whole slew of warnings, which would be fatal if WERROR= was removed: sys/gnu/fs/xfs/xfs_dir2_block.c:1149:17: warning: array index of '1' indexes past the end of an array (that contains 1 element) [-Warray-bounds] dep->name[0] = dep->name[1] = '.'; ^ ~ sys/gnu/fs/xfs/xfs_dir2_data.h:90:2: note: array 'name' declared here __uint8_t name[1]; /* name bytes, no null */ ^ 1 warning generated. sys/gnu/fs/xfs/xfs_dir2_sf.c:117:27: warning: array index of '1' indexes past the end of an array (that contains 1 element) [-Warray-bounds] dep->name[0] == '.' && dep->name[1] == '.'; ^ ~ sys/gnu/fs/xfs/xfs_dir2_data.h:90:2: note: array 'name' declared here __uint8_t name[1]; /* name bytes, no null */ ^ sys/gnu/fs/xfs/xfs_dir2_sf.c:237:28: warning: array index of '1' indexes past the end of an array (that contains 1 element) [-Warray-bounds] dep->name[0] == '.' && dep->name[1] == '.') ^ ~ sys/gnu/fs/xfs/xfs_dir2_data.h:90:2: note: array 'name' declared here __uint8_t name[1]; /* name bytes, no null */ ^ 2 warnings generated. sys/gnu/fs/xfs/xfs_vfsops.c:1958:19: warning: format string is not a string literal (potentially insecure) [-Wformat-security] sbuf_printf(m, xfs_infop->str); ^~~~~~~~~~~~~~ 1 warning generated. sys/gnu/fs/xfs/FreeBSD/xfs_super.c:257:9: warning: format string is not a string literal (potentially insecure) [-Wformat-security] printf(message); ^~~~~~~ 1 warning generated. sys/gnu/fs/xfs/FreeBSD/xfs_stats.c:68:32: warning: format string is not a string literal (potentially insecure) [-Wformat-security] len += sprintf(buffer + len, xstats[i].desc); ^~~~~~~~~~~~~~ sys/gnu/fs/xfs/FreeBSD/xfs_stats.c:99:33: warning: if statement has empty body [-Wempty-body] if (&xfs_read_xfsstats != NULL); ^ 2 warnings generated. sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c:1252:10: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign] error = error; ~~~~~ ^ ~~~~~ sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c:1290:9: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign] error = error; ~~~~~ ^ ~~~~~ sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c:1299:10: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign] error = error; ~~~~~ ^ ~~~~~ sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c:1350:9: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign] error = error; ~~~~~ ^ ~~~~~ 4 warnings generated. Most of the warnings should probably be fixed, but as this is mainly contrib code, and GPL to boot, it makes not much sense to do so.