🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.lang.perl
Article #5

Re: Alignment (Re: Q: Wie arbeite ich mit 'sockets' ?)

#5
From: Thomas Koenig
Date: Sun, 25 Feb 1996 01:24
20 lines
1637 bytes
In de.comp.lang.c, Olaf Titz <olaf@bigred.inka.de> wrote:

>Btw.: Was sagt eigentlich der C-Standard zu dem Problem? (->xpost)

Die Norm sagt so gut wie nichts.

6.5.2.1 sagt:

Within a structure object, the non-bit-field members and the units in
which bit-fields reside shall have addresses that increase in the order
in which they are declared.  A pointer to a structure object, suitably
converted, points to its initial member (or if that member is a
bit-field, then to the unit in which it resides), and vice versa.  There
may therefore be unnamed padding within a structure object, but not at
its beginning, as necessary to achieve the appropriate alignment.

Das wars auch schon.  Es ist in der Norm ja noch nicht einmal festgelegt,
dass alle Bits in einem int auch ausgenutzt werden muessen; man kann
auf einer Maschine mit CHAR_BITS == 9 und sizeof(int)=4 durchaus nur
24 geltende Bits haben :-)
Technical Details
Message-ID: <4godp8$nrl@fg70.rz.uni-karlsruhe.de>
Path: arc1-ca.pugleaf.net!rz.uni-karlsruhe.de!not-for-mail
References: <630lIlhuTgB@fuerst.jena.thur.de> <dn2w18.1pq@inka.de> <4gd000$15d8@info4.rus.uni-stuttgart.de> <dn9xx6.crv@bigred.inka.de>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!rz.uni-karlsruhe.de!not-for-mail
From: ig25@fg70.rz.uni-karlsruhe.de (Thomas Koenig)
Newsgroups: de.comp.lang.perl,de.comp.lang.c
Subject: Re: Alignment (Re: Q: Wie arbeite ich mit 'sockets' ?)
Date: 25 Feb 1996 02:24:56 +0100
Organization: Universität Karlsruhe (TH), Germany 
Message-ID: <4godp8$nrl@fg70.rz.uni-karlsruhe.de>
References: <630lIlhuTgB@fuerst.jena.thur.de> <dn2w18.1pq@inka.de> <4gd000$15d8@info4.rus.uni-stuttgart.de> <dn9xx6.crv@bigred.inka.de>
Reply-To: Thomas.Koenig@ciw.uni-karlsruhe.de
NNTP-Posting-Host: fg70.rz.uni-karlsruhe.de
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-User: ig25