Re: A basic question question about volatile use
- From: Nick Keighley <nick_keighley_nospam@xxxxxxxxxxx>
- Date: Thu, 31 Jul 2008 05:34:53 -0700 (PDT)
On 31 Jul, 08:31, Ark Khasin <akha...@xxxxxxxxxxxxxxxxxxxx> wrote:
santosh wrote:
Ark Khasin wrote:
I was under the impression that if a struct contains only uint8_t and
arrays thereof, there is no padding. Is it wrong?
The [u]intN_t types are specified to contain any padding bits, but
padding between structure members of these types in still allowed.
Of course struct {uint8_t a; uint32_t b; uint8_t c;} is likely to have
padding somewhere. But uint8_t alone?..
your declaration looked like this:-
struct T {uint8_t read, write, status, forkicks;};
So you don't have a lone uint8_t you have 4 of them!
I must admit I'd consider it an odd compiler that padded
between uint8_ts like this.
<muse: "how can I annoy jacob?">
I suppose a machine with 24-bit words packing 3 chars
into a word might insert padding.
ccc00c
--
Nick Keighley
.
- References:
- A basic question question about volatile use
- From: Ark Khasin
- Re: A basic question question about volatile use
- From: Flash Gordon
- Re: A basic question question about volatile use
- From: Ark Khasin
- Re: A basic question question about volatile use
- From: santosh
- Re: A basic question question about volatile use
- From: Ark Khasin
- A basic question question about volatile use
- Prev by Date: Re: Compiler warning
- Next by Date: Re: Doubt
- Previous by thread: Re: A basic question question about volatile use
- Next by thread: Re: A basic question question about volatile use
- Index(es):
Relevant Pages
|