🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4887

Re: alignment requirements for all structures?

#4887
From: Stan Ryckman
Date: Wed, 13 Mar 1996 14:27
21 lines
1122 bytes
In article <1996Mar12.175916.7256@sq.com>, Mark Brader <msb@sq.com> wrote:
:Wil Evers (wil@ittpub.nl) writes:
...
:> For example, if I write:
:> 	#include <stdio.h>
:> 	struct c { char data; } carray[10];
:> 	int main() { printf("%u\n", sizeof carray); return 0; }
:
:... then on a word-addressed machine the output might very well be "40".  On
:that machine, sizeof (struct c *) would probably be 4 while sizeof (char *)
:would be 8, or maybe 6.

Or any machine could output "Segmentation fault... Core dumped"
if size_t is not unsigned int.

Cheers,
Stan.
--
Stan Ryckman  (stanr@tiac.net)
  (Apologies for non-responses or late responses to some posts;
  .newsrc was trashed and I'm trying to get it back to where it was.)
Technical Details
Message-ID: <4i6m18$81a@sundog.tiac.net>
Path: arc1-ca.pugleaf.net!sundog.tiac.net!stanr
References: <1996Mar7.151216.1793@ittpub> <1996Mar12.175916.7256@sq.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sundog.tiac.net!stanr
From: stanr@tiac.net (Stan Ryckman)
Newsgroups: comp.std.c
Subject: Re: alignment requirements for all structures?
Date: 13 Mar 1996 14:27:51 GMT
Organization: Amber & Sneakers Fan Club
Message-ID: <4i6m18$81a@sundog.tiac.net>
References: <1996Mar7.151216.1793@ittpub> <1996Mar12.175916.7256@sq.com>
NNTP-Posting-Host: sunspot.tiac.net