From owner-freebsd-current@FreeBSD.ORG Wed Sep 5 17:59:57 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87DBD106566B for ; Wed, 5 Sep 2012 17:59:57 +0000 (UTC) (envelope-from eirnym@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 525B78FC16 for ; Wed, 5 Sep 2012 17:59:57 +0000 (UTC) Received: by iayy25 with SMTP id y25so1404210iay.13 for ; Wed, 05 Sep 2012 10:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=LOoeQJ0GW3hZBZNxPs8dcQf6CVHev6cfaNBzCNq9iVg=; b=DOea4xWQMEC4/A4nDbxd61LVDyIxE7foIL/y6sOTkpwod9R5OURbuCSh69SqWprefX VMkhGMrjK20Z8njBPxCnriB2Tb0mK6PVYEWW+VE4Jxc96vbBeX+Qw0WVmpshrUcotimD Ux3krbin1a/2CzqdUFRgBybJvsj+QsEKyjknDXRY1Rgas+xmVgx0b5TPwRbyEgOVdgoK WC9y+OIa6/z+eWEyg8aboNYcI4qk5ipvDXHcOrTJ2Ix96tkkVdSl4WOBE6JjAAhuuv/q mbrqQdHG/obyzhazgN0+GkaVhPd9gNk5pnLgseLlux9FtTzB/hqlQAhNJ197koaigEUy dotw== Received: by 10.50.168.105 with SMTP id zv9mr19120800igb.73.1346867996578; Wed, 05 Sep 2012 10:59:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.46.41 with HTTP; Wed, 5 Sep 2012 10:59:36 -0700 (PDT) From: Eir Nym Date: Wed, 5 Sep 2012 21:59:36 +0400 Message-ID: To: FreeBSD Mail Lists Content-Type: text/plain; charset=UTF-8 Subject: Are clang unsigned comparison warnings in kern/kern_* ok? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 17:59:57 -0000 I've got following warnings [no errors had been generated while -Werror is in command line] and want to know if they are ok. There are much more same warnings in modules, but I worry about kernel : Kernel config: http://eroese.org/_/_/pub/bsd/240070/GENERIC_PF.amd64 src.conf: http://eroese.org/_/_/pub/bsd/240070/src.conf make.conf: /dev/null kernel build logs: http://eroese.org/_/_/pub/bsd/240070/kernel.amd64.GENERIC_PF 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 -nostdinc -I. -I/usr/head/src/sys -I/usr/head/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror /usr/head/src/sys/kern/kern_cpuset.c /usr/head/src/sys/kern/kern_cpuset.c:654:16: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] for (i = 0; i < (_NCPUWORDS - 1); i++) { ~ ^ ~~~~~~~~~~~~~~~~ 1 warning generated. /usr/head/src/sys/kern/kern_poll.c:173:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (val < 0 || val > 99) ~~~ ^ ~ 1 warning generated. 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 -nostdinc -I. -I/usr/head/src/sys -I/usr/head/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror /usr/head/src/sys/kern/kern_umtx.c /usr/head/src/sys/kern/kern_umtx.c:3312:19: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (ts32.tv_sec < 0 || ~~~~~~~~~~~ ^ ~ /usr/head/src/sys/kern/kern_umtx.c:3314:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] ts32.tv_nsec < 0) ~~~~~~~~~~~~ ^ ~ /usr/head/src/sys/kern/kern_umtx.c:3338:25: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (t32.timeout.tv_sec < 0 || ~~~~~~~~~~~~~~~~~~ ^ ~ /usr/head/src/sys/kern/kern_umtx.c:3339:63: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] t32.timeout.tv_nsec >= 1000000000 || t32.timeout.tv_nsec < 0) ~~~~~~~~~~~~~~~~~~~ ^ ~ 4 warnings generated. 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 -nostdinc -I. -I/usr/head/src/sys -I/usr/head/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror /usr/head/src/sys/kern/uipc_syscalls.c /usr/head/src/sys/kern/uipc_syscalls.c:356:16: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (*namelen < 0) ~~~~~~~~ ^ ~ /usr/head/src/sys/kern/uipc_syscalls.c:1487:12: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (*alen < 0) ~~~~~ ^ ~ /usr/head/src/sys/kern/uipc_syscalls.c:1587:12: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (*alen < 0) ~~~~~ ^ ~ 3 warnings generated. -- Eir Nym