Date: Thu, 18 Jan 2007 09:38:09 +0100 From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: Craig Rodrigues <rodrigc@FreeBSD.org> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/amd64/include md_var.h Message-ID: <86hcuou3v2.fsf@dwp.des.no> In-Reply-To: <200701180546.l0I5kXpb075646@repoman.freebsd.org> (Craig Rodrigues's message of "Thu, 18 Jan 2007 05:46:32 %2B0000 (UTC)") References: <200701180546.l0I5kXpb075646@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Craig Rodrigues <rodrigc@FreeBSD.org> writes: > Modified files: > sys/amd64/include md_var.h=20 > Log: > Revert previous change. >=20=20=20 > Requested by: kan You shouldn't have reverted this because kan requested it, you should have reverted it because it was simply wrong and broke the build. An array is not the same as a pointer; it only seems that way because the syntax for dereferencing both is the same. There is a fundamental difference: if foo is an array, then &foo is the address at which the contents of the array are stored. If foo is a pointer, then &foo is the address at which the *address* of the array is stored. As regards the "test case" you quoted at kan, your "fix" only appears to work because you have no correct definition or declaration of array_foo in scope. If your sample code actually did something with the arrays / pointers it declares and you tried to run it, you'd get a segfault. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86hcuou3v2.fsf>