Article View: comp.std.c
Article #1535Re: Size of structure containing char fields
From: Stephen Clamage
Date: Sat, 28 Jul 1990 21:43
Date: Sat, 28 Jul 1990 21:43
16 lines
1130 bytes
1130 bytes
jimp@cognos.UUCP (Jim Patterson) writes: >Sun's C compiler on a Sun 3 (with Sun OS 4.0) aligns structs on two >byte boundaries. This is NOT an ANSI-compatible compiler, but I don't >think that the ANSI standard will force them to change their ways. As you noted, the ANSI standard allows padding between and at the end of a struct. The standard does not (and cannot) say anything about where a data object must be located in memory. Recall it is the struct object, not the struct data type, which is being aligned. That object has an address, and whether one or more bytes preceding it in memory are used or not is not business of the Standard. In any event, no portable program can access such bytes, even if they exist. -- Steve Clamage, TauMetric Corp, steve@taumet.com
Technical Details
Message-ID:
<356@taumet.com>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!taumet!steveReferences:
<1030@lzaz.ATT.COM> <8631@cognos.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.std.c Subject: Re: Size of structure containing char fields Message-ID: <356@taumet.com> Date: 28 Jul 90 21:43:16 GMT References: <1030@lzaz.ATT.COM> <8631@cognos.UUCP> Organization: Taumetric Corporation, San Diego Lines: 16