Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 2006 12:04:12 +0300
From:      Yar Tikhiy <yar@comp.chem.msu.su>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        src-committers@FreeBSD.org, bde@zeta.org.au, jkoshy@FreeBSD.org, cvs-all@FreeBSD.org, phk@phk.freebsd.dk, cvs-src@FreeBSD.org
Subject:   Re: cvs commit: src/include ar.h
Message-ID:  <20061116090412.GB37133@comp.chem.msu.su>
In-Reply-To: <20061113.101958.-861030824.imp@bsdimp.com>
References:  <3801.1163410519@critter.freebsd.dk> <20061113214928.P76443@delplex.bde.org> <20061113.101958.-861030824.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 13, 2006 at 10:19:58AM -0700, M. Warner Losh wrote:
> : 
> : BTW, you are responsible for the __packed in <netinet/ip.h>.  Please remove
> : it.  The __CTASSERT() is enough to detect if heroic packing is ever needed.
> : The only danger is if something has grown to depend on __packed reducing
> : alignment as a side effect.  E.g., suppose we had a byte string containing
> : a bytewise copy of a struct ip.  If the copy might be misaligned, then it
> : should be copied to an actual struct ip before accessing it as a struct,
> : but code that accesses it directly using ((struct ip *)&bs[N]) would work
> : now due to the reduced alignment.  Places that really need __packed should
> : probably use __aligned() to restore the natural alignment.
> 
> DO NOT REMOVE IT.  IT IS ABSOLUTELY REQUIRED FOR ARM TO WORK RIGHT.
> If you want to remove it, then you must make sure arm works right
> after it because I'll add it back.

Many years ago I was taught that comments in code could help to
avoid such clashes in software development.  Is this true no more? ;-)

-- 
Yar



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