NetBSD-Bugs archive

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

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



>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:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 27 08:00:00 +0000 2012
>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.

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index