Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Dec 2011 14:06:52 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Alexander Best <arundel@freebsd.org>
Cc:        freebsd-toolchain@freebsd.org, current@freebsd.org, freebsd-arch@freebsd.org
Subject:   Re: [rfc] removing/conditionalising WERROR= in Makefiles
Message-ID:  <4EFDB76C.1030901@FreeBSD.org>
In-Reply-To: <20111226101040.GA6361@freebsd.org>

index | next in thread | previous in thread | raw e-mail

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.


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EFDB76C.1030901>