Date: Fri, 5 Feb 2021 07:30:51 +0800 From: Erich Dollansky <freebsd.ed.lists@sumeritec.com> To: Frank Leonhardt <frank2@fjl.co.uk> Cc: freebsd-questions@freebsd.org Subject: Re: Warnings when compiling kernel Message-ID: <20210204233051.560f4f64.freebsd.ed.lists@sumeritec.com> In-Reply-To: <4a8b2522-2046-6212-9a40-ce1d6c4a0473@fjl.co.uk> References: <alpine.BSF.2.23.453.2101312121500.2098@fbsd.local> <4a8b2522-2046-6212-9a40-ce1d6c4a0473@fjl.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, On Wed, 3 Feb 2021 22:34:28 +0000 Frank Leonhardt <frank2@fjl.co.uk> wrote: > On 31/01/2021 21:22, Roderick wrote: > > > > Are they normal? > > > > """"""""""""""""""""""""""""""""""""" > > cc=C2=A0 -c -O2 -pipe -fno-strict-aliasing=C2=A0 -std=3Dc99=C2=A0 -Wall= =20 > > -Wredundant-decls -Wnested-externs -Wstrict-prototypes=20 > > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual=C2=A0 -Wundef= =20 > > -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs=20 > > -fdiagnostics-show-option -Wno-error-tautological-compare=20 > > -Wno-error-empty-body -Wno-error-parentheses-equality=20 > > -Wno-error-unused-function=C2=A0=C2=A0 -nostdinc -I. -I/usr/src/sys=20 > > -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt -D_KERNEL=20 > > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -mno-aes > > -mno-avx -mno-mmx -mno-sse -msoft-float -ffreestanding > > -fstack-protector -Werror=C2=A0 /usr/src/sys/kern/kern_cpuset.c > > /usr/src/sys/kern/kern_cpuset.c:637:16: warning: comparison of > > unsigned expression < 0 is always false [-Wtautological-compare] > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < (_NCPUWORD= S - 1); i++) { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ~ ^ ~~~~~~~~~~~~~~~~ > > 1 warning generated. > > =20 > Compiler warnings are normal, but I'd rather they weren't there > myself. I wish I knew which file generated the error (it's not from > any of the kernels I have loaded), and which CPU was the target, as I > can't be sure what happens next. However, _NCPUWORDS can quite easily > be 1, which means the for() loop will never be executed on some CPUs. > One would hope the optimiser would remove it completely if this was > the case, and this may have been the intention. >=20 words like 'may have' are the reason for countless software errors. Erich > Regards, Frank. >=20 >=20 >=20 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210204233051.560f4f64.freebsd.ed.lists>