Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Sep 2003 08:51:21 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        adridg@cs.kun.nl
Cc:        freebsd-stable@FreeBSD.org
Subject:   Re: [PATCH?] vm/vm_map.h C++ incompatible
Message-ID:  <200309251551.h8PFpLN1017947@gw.catspoiler.org>
In-Reply-To: <200309251040.25568.adridg@cs.kun.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
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?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309251551.h8PFpLN1017947>