VirtualBox

Opened 15 years ago

Closed 14 years ago

#6715 closed enhancement (fixed)

3.2.0 fails to compile with gcc 4.5

Reported by: Bernhard Rosenkraenzer Owned by:
Component: other Version: VirtualBox 3.2.0
Keywords: Cc:
Guest type: other Host type: Linux

Description

VirtualBox 3.2.0 fails to build with gcc 4.5 -- first, the configure check barfs because it isn't aware of gcc 4.5 existing.

After adapting it, the build fails because -Werror is used, and gcc 4.5 produces some new warnings:

cc1plus: warnings being treated as errors In file included from /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAl l/PGMAll.cpp:236:0: /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAll/PGMAllGst.h: In func tion âint pgmR3GstAMD64GetPage(VMCPU*, RTGCPTR, uint64_t*, RTGCPHYS*)â: /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAll/PGMAllGst.h:81:17: error: âPdpe.X86PDPE::lm.X86PDPEAMD64BITS::u1Writeâ may be used uninitialized in this function [-Wuninitialized] /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAll/PGMAllGst.h:81:17: error: âPdpe.X86PDPE::lm.X86PDPEAMD64BITS::u1Userâ may be used uninitialized in this function [-Wuninitialized] /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAll/PGMAllGst.h:81:17: error: âPdpe.X86PDPE::lm.X86PDPEAMD64BITS::u1Accessedâ may be used uninitialized in this function [-Wuninitialized] /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAll/PGMAllGst.h:81:17: error: âPdpe.X86PDPE::lm.X86PDPEAMD64BITS::u1NoExecuteâ may be used uninitialized in this function [-Wuninitialized] /usr/src/ark/BUILD/VirtualBox-3.2.0_OSE/src/VBox/VMM/VMMAll/PGMAllGst.h:81:17: error: âPdpe.X86PDPE::n.X86PDPEBITS::u1Presentâ may be used uninitialized in this function [-Wuninitialized]

Attachments (2)

VirtualBox-gcc-4.5.patch (712 bytes ) - added by Bernhard Rosenkraenzer 15 years ago.
Adapt configure check
VirtualBox-3.2.0-gcc-4.5-warning-workaround.patch (523 bytes ) - added by Bernhard Rosenkraenzer 15 years ago.
Workaround for the (apparently bogus) warning produced by gcc 4.5

Download all attachments as: .zip

Change History (5)

by Bernhard Rosenkraenzer, 15 years ago

Attachment: VirtualBox-gcc-4.5.patch added

Adapt configure check

by Bernhard Rosenkraenzer, 15 years ago

Workaround for the (apparently bogus) warning produced by gcc 4.5

comment:1 by Frank Mehnert, 15 years ago

First, your patch to configure does not apply. I don't know where you downloaded the 3.2.0 OSE sources but the sources from the official site contain a configure script which is aware of gcc-4.5.

To workaround the -Werror issues you can add

VBOX_WITH_WARNINGS_AS_ERRORS :=

to a file LocalConfig.kmk which you put into the root directory of your tree.

comment:2 by Luiz Angelo Daros de Luca, 14 years ago

Hello,

I also have problems with "gcc (SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292]" for trunk and 3.6.4. This is avaiable in OpenSUSE 11.3 x86_64:

cc1plus: warnings being treated as errors
/mnt/dados/devel/vbox/src/VBox/Devices/Network/SrvIntNetR0.cpp: In function ‘void intnetR0TrunkIfSend(INTNETTRUNKIF*, INTNETNETWORK*, INTNETIF*, uint32_t, INTNETSG*)’:
/mnt/dados/devel/vbox/src/VBox/Devices/Network/SrvIntNetR0.cpp:2571:21: error: array subscript is above array bounds [-Warray-bounds]
/mnt/dados/devel/vbox/src/VBox/Devices/Network/SrvIntNetR0.cpp:2572:21: error: array subscript is above array bounds [-Warray-bounds]
/mnt/dados/devel/vbox/src/VBox/Devices/Network/SrvIntNetR0.cpp:2573:21: error: array subscript is above array bounds [-Warray-bounds]
kBuild: Generating python - /mnt/dados/devel/vbox/out/linux.amd64/debug/obj/VBoxOGLgen/unpack_extend.h

I'll use the workarround

comment:3 by Frank Mehnert, 14 years ago

Resolution: fixed
Status: newclosed

Fixed long time ago.

Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette