From owner-freebsd-bugs@FreeBSD.ORG Sun Jun 22 17:33:37 2008 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE12E106564A for ; Sun, 22 Jun 2008 17:33:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 512D78FC13 for ; Sun, 22 Jun 2008 17:33:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c220-239-252-11.carlnfd3.nsw.optusnet.com.au (c220-239-252-11.carlnfd3.nsw.optusnet.com.au [220.239.252.11]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m5MHXXZZ001054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Jun 2008 03:33:35 +1000 Date: Mon, 23 Jun 2008 03:33:33 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Garrett Cooper In-Reply-To: <7d6fde3d0806210854y1c3be9ds1e1836b1c08ee671@mail.gmail.com> Message-ID: <20080623031321.G71280@delplex.bde.org> References: <200806210030.m5L0U3Jr079362@freefall.freebsd.org> <20080621224835.L67195@delplex.bde.org> <7d6fde3d0806210854y1c3be9ds1e1836b1c08ee671@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-bugs@FreeBSD.org, Bruce Evans Subject: Re: kern/68081: [headers] [patch] sys/time.h (lint fix) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2008 17:33:37 -0000 On Sat, 21 Jun 2008, Garrett Cooper wrote: > On Sat, Jun 21, 2008 at 6:22 AM, Bruce Evans wrote: >> On Sat, 21 Jun 2008, Garrett Cooper wrote: >> >>> Haven't used lint(1) before, but I don't think this is an issue (at >>> least not on 8-CURRENT): >> >> All these bugs (in lint, not in the source code) seem to be unchanged >> in -current. You probably tested on amd64, where the proposed fix has >> no effect except to add even more style bugs than on i386. >> >> tv_nsec has type long on all machines, and lint doesn't like assigning >> uint64_t's to longs when uint64_t is longer than long. On amd64, >> ... > Actually I was using x86: > > [gcooper@optimus /devel/ncvs/ports]$ uname -mr > 8.0-CURRENT i386 > > (I'm not 100% sure) but a lot of things could have changed since 5.x, > most notably the defining types of some of the structures. They seem > to now properly align with one another, and if I apply your changes, > gcc (with the default warnings enabled) complains that the shifting > doesn't fit the actual data type size. Er, I didn't submit any changes. Only null changes in the header are correct. Your reported success was actually from not running lint with any of the options -cghapbx as specified in the How-To-Repeat. It is the -a option that gives the warning for assignments of long variables to variables that are not long. In fact, this option is documented to do give warnings for precisely this, and there is -aa option that gives warnings for all implicit narrowing conversions. However the documentation is wrong: plain -a also gives warnings for assignments of long long variables to longs and for similar assignments with unsigned types. Testing with this option alone gives the behaviour that I described -- no warning on amd64 since there are no long longs in sight (most variables are long), but warnings on i386 since there is a mixture of long longs and longs. (There are a few ints in sight, but only expanding conversions from these.) Header files should also be clean against -aa. The largest source of spurious warnings is now the incomplete pthread struct declarations in . Bruce