NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/46864: compile warnings in 5_1_STABLE in sys/dev/pci_subr.c



The following reply was made to PR kern/46864; it has been noted by GNATS.

From: Wolfgang Stukenbrock <wolfgang.stukenbrock%nagler-company.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: kern-bug-people%NetBSD.org@localhost, gnats-admin%NetBSD.org@localhost, 
netbsd-bugs%NetBSD.org@localhost
Subject: Re: kern/46864: compile warnings in 5_1_STABLE in sys/dev/pci_subr.c
Date: Mon, 27 Aug 2012 12:53:39 +0200

 Hi,
 
 Hmmmmm ....
 
 I've just running the build.sh script with some options for the 
 directories to compile everything.
 I'm not shure if this was reported before.
 
 What is the official way to compile the sources without running lint ???
 I don't remember an option on the command line of build.sh for this.
 
 It is not very usefull to for "normal" users to be confused by "some" 
 lint error messages that should be simply ignored.
 Perhaps the "default" should be changed to "do not run lint" and can be 
 turned on if desired by developers if they want it.
 
 W. Stukenbrock
 
 David Laight wrote:
 
 > The following reply was made to PR kern/46864; it has been noted by GNATS.
 > 
 > From: David Laight <david%l8s.co.uk@localhost>
 > To: gnats-bugs%NetBSD.org@localhost
 > Cc: 
 > Subject: Re: kern/46864: compile warnings in 5_1_STABLE in sys/dev/pci_subr.c
 > Date: Mon, 27 Aug 2012 10:39:33 +0100
 > 
 >  On Mon, Aug 27, 2012 at 08:00:01AM +0000, 
 > Wolfgang.Stukenbrock%nagler-company.com@localhost wrote:
 >  > >Number:         46864
 >  > >Category:       kern
 >  > >Synopsis:       compile warnings in 5_1_STABLE in sys/dev/pci_subr.c
 >  ...
 >  >   The fist block is a warning for calls like "snprintf(cp, ep - cp, ...), 
 > where cp and ep are of type "char *".
 >  >   The compiler generates a signed value from that, but snprintf param 2 
 > is unsigned.
 >  
 >  More because likely 'ep - cp' is 64bit.
 >  
 >  >   The second block seems to be a "gcc feature" ...
 >  >   "(caps >> 6) & 7" and simular expressions produce the warning where 
 > "caps" is of type "uint16_t".
 >  
 >  No, C requires uint16_t be promoted to signed int before any arithmetic.
 >  Although shifts of +ve numbers are fine - and lint could know this.
 >  
 >  >   The last one passes a variable 'off' of type "int" where the functions 
 > expects an "unsigned int".
 >  
 >  > >Fix:
 >  Don't run lint :-)
 >  
 >  
 >      David
 >  
 >  -- 
 >  David Laight: david%l8s.co.uk@localhost
 >  
 > 
 > 
 
 


Home | Main Index | Thread Index | Old Index