[TUHS] Introduction

Jose R. Valverde jrvalverde at cnb.csic.es
Thu Jul 3 20:12:07 AEST 2008


On Tue, 1 Jul 2008 20:35:41 +0200
Oliver Lehmann <lehmann at ans-netz.de> wrote:
> Jose R. Valverde wrote:
> 
> > 	u.u_dirp.l = (caddr_t) ((long) (((saddr_t) (uap->linkname).l) & 0x7F00FFFF);
> 
> I've added a missing ) behind .l:
> 
>  	u.u_dirp.l = (caddr_t) ((long) (((saddr_t) (uap->linkname).l)) &
> 0x7F00FFFF);
> 
> And I've got:
> 
> "sys2.c":305: warning: struct/union or struct/union pointer required
> "sys2.c":305: operands of CAST have incompatible types
> 
>
That looks like the compiler is ignoring the parenthesis... So,
maybe what happened was that the original author also tried several 
of these combinations and failed as well, and may be -as I mentioned-

On Tue, 1 Jul 2008 16:21:02 +0200
"Jose R. Valverde" <jrvalverde at cnb.csic.es> wrote:
> the author faced a difficult to parse
> expression and broke it with an auxiliary variable,
> 
> 	saddr_t aux;
> 
> 	aux.l = (caddr_t) uap->linkname;
> 	u.u_dirp.l = (caddr_t) ((long) aux.l & 0x7F00FFFF);

or some such.

					j
-- 
	These opinions are mine and only mine. Hey man, I saw them first!

			    José R. Valverde

	De nada sirve la Inteligencia Artificial cuando falta la Natural
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20080703/ca63f7f6/attachment.sig>


More information about the TUHS mailing list