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)
Change History (5)
by , 15 years ago
Attachment: | VirtualBox-gcc-4.5.patch added |
---|
by , 15 years ago
Attachment: | VirtualBox-3.2.0-gcc-4.5-warning-workaround.patch added |
---|
Workaround for the (apparently bogus) warning produced by gcc 4.5
comment:1 by , 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 , 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
Adapt configure check