From owner-freebsd-questions@freebsd.org Wed Feb 3 22:36:30 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A52C52EB01 for ; Wed, 3 Feb 2021 22:36:30 +0000 (UTC) (envelope-from freebsd-doc@fjl.co.uk) Received: from bs1.fjl.org.uk (bs1.fjl.org.uk [84.45.41.196]) by mx1.freebsd.org (Postfix) with ESMTP id 4DWGkP5k4Gz3vSh for ; Wed, 3 Feb 2021 22:36:29 +0000 (UTC) (envelope-from freebsd-doc@fjl.co.uk) Received: from [192.168.1.181] (host86-167-39-8.range86-167.btcentralplus.com [86.167.39.8]) (authenticated bits=0) by bs1.fjl.org.uk (8.14.4/8.14.4) with ESMTP id 113MaS97086362 for ; Wed, 3 Feb 2021 22:36:28 GMT (envelope-from freebsd-doc@fjl.co.uk) From: freebsd-doc@fjl.co.uk Subject: Re: Warnings when compiling kernel To: freebsd-questions@freebsd.org References: Message-ID: <4f819960-db08-190f-e0d3-5d4c55cd104e@fjl.co.uk> Date: Wed, 3 Feb 2021 22:37:29 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Rspamd-Queue-Id: 4DWGkP5k4Gz3vSh X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-doc@fjl.co.uk designates 84.45.41.196 as permitted sender) smtp.mailfrom=freebsd-doc@fjl.co.uk X-Spamd-Result: default: False [-3.40 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MID_RHS_MATCH_FROM(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:84.45.41.196:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_NA(0.00)[fjl.co.uk]; RCVD_IN_DNSWL_MED(-0.20)[84.45.41.196:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_NO_DN(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:25577, ipnet:84.45.0.0/17, country:GB]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions]; RECEIVED_SPAMHAUS_PBL(0.00)[86.167.39.8:received] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 22:36:30 -0000 On 31/01/2021 21:22, Roderick wrote: > > Are they normal? > > """"""""""""""""""""""""""""""""""""" > cc  -c -O2 -pipe -fno-strict-aliasing  -std=c99  -Wall > -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef > -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs > -fdiagnostics-show-option -Wno-error-tautological-compare > -Wno-error-empty-body -Wno-error-parentheses-equality > -Wno-error-unused-function   -nostdinc -I. -I/usr/src/sys > -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt -D_KERNEL > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -mno-aes -mno-avx > -mno-mmx -mno-sse -msoft-float -ffreestanding -fstack-protector > -Werror  /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] >         for (i = 0; i < (_NCPUWORDS - 1); i++) { >                     ~ ^ ~~~~~~~~~~~~~~~~ > 1 warning generated. > 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. Regards, Frank.