NetBSD Problem Report #46864
From Wolfgang.Stukenbrock@nagler-company.com Mon Aug 27 07:57:18 2012
Return-Path: <Wolfgang.Stukenbrock@nagler-company.com>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
by www.NetBSD.org (Postfix) with ESMTP id CA58063B8E6
for <gnats-bugs@gnats.NetBSD.org>; Mon, 27 Aug 2012 07:57:18 +0000 (UTC)
Message-Id: <20120827075707.2B8A51E80A9@test-s0.nagler-company.com>
Date: Mon, 27 Aug 2012 09:57:07 +0200 (CEST)
From: Wolfgang.Stukenbrock@nagler-company.com
Reply-To: Wolfgang.Stukenbrock@nagler-company.com
To: gnats-bugs@gnats.NetBSD.org
Subject: compile warnings in 5_1_STABLE in sys/dev/pci_subr.c
X-Send-Pr-Version: 3.95
>Number: 46864
>Category: kern
>Synopsis: compile warnings in 5_1_STABLE in sys/dev/pci_subr.c
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Aug 27 08:00:00 +0000 2012
>Closed-Date: Sat Sep 24 23:16:57 +0000 2016
>Last-Modified: Sat Sep 24 23:16:57 +0000 2016
>Originator: Wolfgang Stukenbrock
>Release: NetBSD 5_1_STABLE
>Organization:
Dr. Nagler & Company GmbH
>Environment:
System: NetBSD test-s0 4.0 NetBSD 4.0 (NSW-WS) #0: Tue Aug 17 17:28:09 CEST 2010 wgstuken@test-s0:/usr/src/sys/arch/amd64/compile/NSW-WS amd64
Architecture: x86_64
Machine: amd64
>Description:
While compiling the sources (5_1_STABLE transeferd some days ago) I got the following compiler messages:
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(393): warning: conversion to 'unsigned int' due to prototype, arg #2 [259]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(396): warning: conversion to 'unsigned int' due to prototype, arg #2 [259]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(399): warning: conversion to 'unsigned int' due to prototype, arg #2 [259]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(401): warning: conversion to 'unsigned int' due to prototype, arg #2 [259]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(404): warning: conversion to 'unsigned int' due to prototype, arg #2 [259]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(409): warning: conversion to 'unsigned int' due to prototype, arg #2 [259]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(412): warning: conversion to 'unsigned int' due to prototype, arg #2 [259]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(416): warning: conversion to 'unsigned int' due to prototype, arg #2 [259]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(419): warning: conversion to 'unsigned int' due to prototype, arg #2 [259]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(420): warning: conversion to 'unsigned int' due to prototype, arg #2 [259]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(877): warning: bitwise operation on signed value possibly nonportable [117]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(921): warning: bitwise operation on signed value possibly nonportable [117]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(923): warning: bitwise operation on signed value possibly nonportable [117]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(924): warning: bitwise operation on signed value possibly nonportable [117]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(929): warning: bitwise operation on signed value possibly nonportable [117]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(930): warning: bitwise operation on signed value possibly nonportable [117]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(932): warning: bitwise operation on signed value possibly nonportable [117]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(933): warning: bitwise operation on signed value possibly nonportable [117]
/export/NetBSD-5.1.2/src/sys/dev/pci/pci_subr.c(1329): warning: conversion to 'unsigned int' due to prototype, arg #5 [259]
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.
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".
The last one passes a variable 'off' of type "int" where the functions expects an "unsigned int".
>How-To-Repeat:
Get Sources and try to compile them - should also happen in current, because (at least some of) the affected lines have not changed in CVS.
>Fix:
Add some cast operation to shut up the compiler and change type of variable "off" to kill the last warning.
>Release-Note:
>Audit-Trail:
From: David Laight <david@l8s.co.uk>
To: gnats-bugs@NetBSD.org
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 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
From: Wolfgang Stukenbrock <wolfgang.stukenbrock@nagler-company.com>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
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>
> To: gnats-bugs@NetBSD.org
> 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 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
>
>
>
From: christos@zoulas.com (Christos Zoulas)
To: Wolfgang Stukenbrock <wolfgang.stukenbrock@nagler-company.com>,
gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
netbsd-bugs@NetBSD.org
Subject: Re: kern/46864: compile warnings in 5_1_STABLE in sys/dev/pci_subr.c
Date: Mon, 27 Aug 2012 07:36:05 -0400
On Aug 27, 12:53pm, wolfgang.stukenbrock@nagler-company.com (Wolfgang Stukenbrock) wrote:
-- Subject: Re: kern/46864: compile warnings in 5_1_STABLE in sys/dev/pci_sub
| 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
MKLINT=no
christos
From: Wolfgang Stukenbrock <wolfgang.stukenbrock@nagler-company.com>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: kern/46864: compile warnings in 5_1_STABLE in sys/dev/pci_subr.c
Date: Tue, 28 Aug 2012 09:17:30 +0200
Hi again,
setting "-V MKLINT=no" on the command line of build.sh eliminates the
misleading warning messages.
Thanks for the hint.
My suggestion to change the default mode in respect to running lint or
not and (perhaps) adding a documented commandline option to the build.sh
script that changes the default setting, is some kind of religion question.
I would prefere to run "standard" builds without lint if it produces
misleading messages - e.g. if cross-building the sources (as I'm dooing
for i386 on an amd64 system) lint doesn't take care about this fact as
far as I can see.
Neverless, I think you can close this report.
Best regards
W. Stukenbrock
Christos Zoulas wrote:
> The following reply was made to PR kern/46864; it has been noted by GNATS.
>
> From: christos@zoulas.com (Christos Zoulas)
> To: Wolfgang Stukenbrock <wolfgang.stukenbrock@nagler-company.com>,
> gnats-bugs@NetBSD.org
> Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
> netbsd-bugs@NetBSD.org
> Subject: Re: kern/46864: compile warnings in 5_1_STABLE in sys/dev/pci_subr.c
> Date: Mon, 27 Aug 2012 07:36:05 -0400
>
> On Aug 27, 12:53pm, wolfgang.stukenbrock@nagler-company.com (Wolfgang Stukenbrock) wrote:
> -- Subject: Re: kern/46864: compile warnings in 5_1_STABLE in sys/dev/pci_sub
>
> | 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
>
> MKLINT=no
>
> christos
>
>
>
--
Dr. Nagler & Company GmbH
Hauptstraße 9
92253 Schnaittenbach
Tel. +49 9622/71 97-42
Fax +49 9622/71 97-50
Wolfgang.Stukenbrock@nagler-company.com
http://www.nagler-company.com
Hauptsitz: Schnaittenbach
Handelregister: Amberg HRB
Gerichtsstand: Amberg
Steuernummer: 201/118/51825
USt.-ID-Nummer: DE 273143997
Geschäftsführer: Dr. Martin Nagler, Dr. Dr. Karl-Kuno Kunze
From: christos@zoulas.com (Christos Zoulas)
To: Wolfgang Stukenbrock <wolfgang.stukenbrock@nagler-company.com>,
gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
netbsd-bugs@NetBSD.org
Subject: Re: kern/46864: compile warnings in 5_1_STABLE in sys/dev/pci_subr.c
Date: Tue, 28 Aug 2012 03:20:01 -0400
On Aug 28, 9:17am, wolfgang.stukenbrock@nagler-company.com (Wolfgang Stukenbrock) wrote:
-- Subject: Re: kern/46864: compile warnings in 5_1_STABLE in sys/dev/pci_sub
| Hi again,
|
| setting "-V MKLINT=no" on the command line of build.sh eliminates the
| misleading warning messages.
|
| Thanks for the hint.
|
| My suggestion to change the default mode in respect to running lint or
| not and (perhaps) adding a documented commandline option to the build.sh
| script that changes the default setting, is some kind of religion question.
| I would prefere to run "standard" builds without lint if it produces
| misleading messages - e.g. if cross-building the sources (as I'm dooing
| for i386 on an amd64 system) lint doesn't take care about this fact as
| far as I can see.
|
| Neverless, I think you can close this report.
I think that putting it in /etc/mk.conf works too.
christos
From: Wolfgang Stukenbrock <wolfgang.stukenbrock@nagler-company.com>
To: Christos Zoulas <christos@zoulas.com>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
netbsd-bugs@NetBSD.org
Subject: Re: kern/46864: compile warnings in 5_1_STABLE in sys/dev/pci_subr.c
Date: Tue, 28 Aug 2012 09:27:02 +0200
Hi,
of cause the /etc/mk.conf version will work too, but that would disabled
lint for every compilation that uses make "silently".
I'm not shure if that won't surprise some of my college if they are
building something else on that server.
So I prefere disabling just for building the sources.
Best regards
W. Stukenbrock
Christos Zoulas wrote:
> On Aug 28, 9:17am, wolfgang.stukenbrock@nagler-company.com (Wolfgang Stukenbrock) wrote:
> -- Subject: Re: kern/46864: compile warnings in 5_1_STABLE in sys/dev/pci_sub
>
> | Hi again,
> |
> | setting "-V MKLINT=no" on the command line of build.sh eliminates the
> | misleading warning messages.
> |
> | Thanks for the hint.
> |
> | My suggestion to change the default mode in respect to running lint or
> | not and (perhaps) adding a documented commandline option to the build.sh
> | script that changes the default setting, is some kind of religion question.
> | I would prefere to run "standard" builds without lint if it produces
> | misleading messages - e.g. if cross-building the sources (as I'm dooing
> | for i386 on an amd64 system) lint doesn't take care about this fact as
> | far as I can see.
> |
> | Neverless, I think you can close this report.
>
> I think that putting it in /etc/mk.conf works too.
>
> christos
>
>
--
Dr. Nagler & Company GmbH
Hauptstraße 9
92253 Schnaittenbach
Tel. +49 9622/71 97-42
Fax +49 9622/71 97-50
Wolfgang.Stukenbrock@nagler-company.com
http://www.nagler-company.com
Hauptsitz: Schnaittenbach
Handelregister: Amberg HRB
Gerichtsstand: Amberg
Steuernummer: 201/118/51825
USt.-ID-Nummer: DE 273143997
Geschäftsführer: Dr. Martin Nagler, Dr. Dr. Karl-Kuno Kunze
State-Changed-From-To: open->closed
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Sat, 24 Sep 2016 23:16:57 +0000
State-Changed-Why:
closed both at submitters request (ages ago) and being netbsd-5 specific.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.