Re: Structure size directives
- From: those who know me have no need of my name <not-a-real-address@xxxxxxx>
- Date: 07 Dec 2007 06:10:40 GMT
in comp.lang.c i read:
those who know me have no need of my name wrote:
Unaligned accesses to objects, should be banned. It has nothing
to do with portable C code,
i think jacob's point is that people want these "dense" struct's and
that there should be a way to get the compiler to emit the code
necessary to marshall the data.
I think he, and they, are mistaken. Code has quite different objectives
today than it used to. There was a time when memory was extremely
precious, and we took almost all options to economize it. Today, memory
(and disk storage) is cheap, and we use it freely. However nothing has
reduced the need for clear and understandable code.
c is still quite heavily used on platforms where memory remains tight,
though generally not quite so much as was once the case. still, if the
language (and thus this is really a comp.std.c issue more than clc)
provided a portable way of specifying that the struct should be as compact
as possible and that the platform demands for alignment be handled by the
compiler would mean even more code that would be portable, whether compiled
on a system with tight memory requirements or one with all the memory in
the world at hand. in the absence of such a facility we are left with
myriad implementation specific ways of accomplishing the same thing, and
(perhaps) fall-back code that handles it in the most general way possible
(it is hoped). much the same rationale applies as for the potentially
better code provided by memset or memcpy, else we should avoid them and
just write the loops.
BTW, please do not strip attributions for material you quote.
i stripped none. i added what i felt was appropriate -- as i feel i am not
speaking to a person as much as on a topic, already described in the
subject, and so where the content originated is the next most important.
even that isn't really worth mention, though even more stiff necked
responses would arrive had i provided nothing. i note that you stripped
what i provided, surely you should walk your own walk, neh? oh, and that
double sig ... never mind, i know how to ignore/trim such things without
whining at the author about minor infelicities.
--
a signature
.
- References:
- Structure size directives
- From: jacob navia
- Re: Structure size directives
- From: Tor Rustad
- Re: Structure size directives
- From: those who know me have no need of my name
- Re: Structure size directives
- From: CBFalconer
- Structure size directives
- Prev by Date: Re: Code problem
- Next by Date: Re: c++ calling c functions
- Previous by thread: Re: Structure size directives
- Next by thread: Re: Structure size directives
- Index(es):
Relevant Pages
|