Article View: comp.std.c++
Article #2084Re: Alignment
From: Bob Kline
Date: Sun, 01 Oct 1995 22:21
Date: Sun, 01 Oct 1995 22:21
38 lines
2222 bytes
2222 bytes
A few weeks ago, James Kanze wrote a followup to an question I posted about whether the draft standard contained anything to support the validity of some code from "Advanced C++" which appeared to rely on the assumption that a static array of char would be guaranteed to be suitably aligned for holding any data type. In part, he wrote: > In defence of Jim Coplien, I'm too lazy to look up the exact example, > but from the name (LAPD), I'd guess that this is a class whose data will > be read from or written to an external source, and which because of > this, will only contain byte data anyway. (LAPD is the name of the > layer two protocol in the OSI protocol suite.) If this is the case, his > example should work anyway. James: Sorry it took me so long to respond to your hypothesis above, but the news server at our site started dropping articles on the floor just about the time you posted the quoted article, and I only now came across it using the DejaNews search service. The LAPD class contains (among other things) some pointers, which would choke on many machines if the alignment requirements were not satisfied. The answers I got confirmed my suspicion that the assumptions on which the quoted code was relying were invalid. -- /*----------------------------------------------------------------------*/ /* Bob Kline Stream International */ /* bob_kline@stream.com formerly Corporate Software, Inc. */ /* voice: (703) 522-0820 x-311 fax: (703) 522-5407 */ /*----------------------------------------------------------------------*/ --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<44mqif$7s2@lhc.nlm.nih.gov>Path:
arc1-ca.pugleaf.net!newsxfer.itd.umich.edu!agate!agate!MattShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!newsxfer.itd.umich.edu!agate!agate!Matt From: bkline@cortex.nlm.nih.gov (Bob Kline) Newsgroups: comp.std.c++ Subject: Re: Alignment Date: 01 Oct 1995 22:21:13 GMT Organization: National Library of Medicine Approved: Matt@Austern Message-ID: <44mqif$7s2@lhc.nlm.nih.gov> NNTP-Posting-Host: austern.hip.berkeley.edu