Bug 164203

Summary: [smp] usr/src/sys/sys/smp.h:124: warning: comparison between signed and unsigned
Product: Base System Reporter: Oliver <grimeton>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: 9.0-RELEASE   
Hardware: Any   
OS: Any   

Description Oliver 2012-01-16 15:50:09 UTC
Hello,

I'm trying to build VirtualBox on 9.0-Release and get the following warning:

=======8<=====SNIP==========
In file included from /opt/vbox/VirtualBox-4.1.8_OSE/src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h:57,
                 from /opt/vbox/VirtualBox-4.1.8_OSE/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c:35:
/usr/src/sys/sys/smp.h: In function 'cpu_next':
/usr/src/sys/sys/smp.h:124: warning: comparison between signed and unsigned
In file included from /opt/vbox/VirtualBox-4.1.8_OSE/src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h:57,
                 from /opt/vbox/VirtualBox-4.1.8_OSE/src/VBox/Runtime/r0drv/freebsd/process-r0drv-freebsd.c:34:
/usr/src/sys/sys/smp.h: In function 'cpu_next':
/usr/src/sys/sys/smp.h:124: warning: comparison between signed and unsigned
/opt/vbox/VirtualBox-4.1.8_OSE/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c: In function 'rtR0MemObjFreeBSDPhysPageInit':
/opt/vbox/VirtualBox-4.1.8_OSE/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c:398: error: 'PG_UNMANAGED' undeclared (first use in this function)
/opt/vbox/VirtualBox-4.1.8_OSE/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c:398: error: (Each undeclared identifier is reported only once
/opt/vbox/VirtualBox-4.1.8_OSE/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c:398: error: for each function it appears in.)
In file included from /opt/vbox/VirtualBox-4.1.8_OSE/src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h:57,
                 from /opt/vbox/VirtualBox-4.1.8_OSE/src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c:35:
/usr/src/sys/sys/smp.h: In function 'cpu_next':
/usr/src/sys/sys/smp.h:124: warning: comparison between signed and unsigned
kmk: *** [/opt/vbox/VirtualBox-4.1.8_OSE/out/freebsd.amd64/release/obj/RuntimeR0Drv/r0drv/freebsd/memobj-r0drv-freebsd.o] Error 1

=========>8=========SNAP=============

I checked /usr/src/sys/sys/smp.h and can see that mp_maxid is declared as extern u_int. But I'm not sure if this is a compiler problem or just a wrong declaration on line 124, for cpu_next(int i).

If it's changed to cpu_next(u_int i) it works, and virtualbox compiles and works too.

Thanks.

KR,

Grimeton

Fix: 

One can change the delaration of cpu_next() to cpu_next(u_int i).
How-To-Repeat: - Install 9.0-RELEASE
- Install src.txz from your fav. server
- Get VirtualBox 4.1.8 sources from www.virtualbox.org
- configure and build virtualbox and see the error message from above
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:16 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped