On 4.9-pre, vm/vm_map.h is not C++ compatible, due to this kind of call:
lockmgr(&(map)->lock, LK_RELEASE, (void *)0, curproc);
C++ (or rather, gcc 2.95.4) refuses to cast (void *) to the desired (struct
simplelock *), so C++ compilations that accidentally include vm/vm_map.h
fail. So do C++ compiles that intentionally pick it up, like kfontinst, which
is why I'm cc-ing kde@.
The attached patch replaces all the (void *) casts with casts to the correct
type; this fixes kfontinst, at the very least. It doesn't seem to hurt C
compilation, either.
--
pub 1024D/FEA2A3FE 2002-06-18 Adriaan de Groot <groot@kde.org>
Key fingerprint = 934E 31AA 80A7 723F 54F9 50ED 76AC EE01 FEA2 A3FE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vm_map.diff
Type: text/x-diff
Size: 3074 bytes
Desc: not available
Url :
http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20030925/2082e514/vm_map.bin
On 25 Sep, Adriaan de Groot wrote:> On 4.9-pre, vm/vm_map.h is not C++ compatible, due to this kind of call: > > lockmgr(&(map)->lock, LK_RELEASE, (void *)0, curproc); > > C++ (or rather, gcc 2.95.4) refuses to cast (void *) to the desired (struct > simplelock *), so C++ compilations that accidentally include vm/vm_map.h > fail. So do C++ compiles that intentionally pick it up, like kfontinst, which > is why I'm cc-ing kde@. > > The attached patch replaces all the (void *) casts with casts to the correct > type; this fixes kfontinst, at the very least. It doesn't seem to hurt C > compilation, either.Why not just use NULL instead of messing around with casts?
On Thursday 25 September 2003 10:40, Adriaan de Groot wrote:> On 4.9-pre, vm/vm_map.h is not C++ compatible, due to this kind of call: > > lockmgr(&(map)->lock, LK_RELEASE, (void *)0, curproc); > > C++ (or rather, gcc 2.95.4) refuses to cast (void *) to the desired (struct > simplelock *), so C++ compilations that accidentally include vm/vm_map.h > fail. So do C++ compiles that intentionally pick it up, like kfontinst, > which is why I'm cc-ing kde@.Don't strip -pedantic from the CXXFLAGS and it's turned into a warning. -- Melvyn ======================================================FreeBSD ghost.lan.webteckies.org 4.8-STABLE FreeBSD 4.8-STABLE #5: Tue Sep 2 17:36:05 CEST 2003 root@ghost.lan.webteckies.org:/usr/obj/usr/src/sys/ GHOST i386 ======================================================-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: signature Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20030925/374efd90/attachment.bin