Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 May 2002 21:15:42 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Marcel Moolenaar <marcel@xcllnt.net>, Garrett Wollman <wollman@khavrinen.lcs.mit.edu>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/sys/sys gpt.h 
Message-ID:  <20020530210358.G28585-100000@gamplex.bde.org>
In-Reply-To: <17233.1022705363@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 29 May 2002, Poul-Henning Kamp wrote:

> In message <20020529133846.E64995@kayak.xcllnt.net>, Marcel Moolenaar writes:
> >On Wed, May 29, 2002 at 04:27:41PM -0400, Garrett Wollman wrote:
>
> >> The C programming language does not work that way, and has never
> >> worked that way.
>
> does not work that way: true.
> never worked that way: false.   It did, it just wasn't documented that
> it would continue to do so.

Nah, always worked that way.  K&R 1 has lots of restrictions to alignment
requirements, and structs obviously needed padding to satisfy these
requirements even when there were no more than chars, shorts and ints to
put in them:

	struct foo {
		char	x;
		/* Unnamed padding here if y must be aligned. */
		int	y;
	};

	struct bar {
		int	x;
		char	y;
		/* Unnamed padding here if x must be aligned. */
	};

int64_t followed by int32_t is just the same sort of thing with larger types.

> >Ah, well... No point getting all "Don Quixote" about this...
>
> Right.  On the other hand, if the C-standards people had been a bit
> more future-interested, they would have added a proper bitmap type
> and a way to specify storage layout for hardware/on-media format
> structs, but such useful features never survive standards bodies.

Mainly because they can't all be implemented on all machines that the
standards people want to support.  Optional featurs would be harder
to specify properply and harder to use (where are all our ifdefs for
optional and gcc-specific features?).

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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