Re: A basic question question about volatile use



Ark Khasin wrote:

Flash Gordon wrote:
Be aware that the compiler is allowed to put in padding. Since this
is obviously for non-portable code it might be sufficient to just put
in a comment in the code stating that you are relying on the compiler
not putting in any padding.
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.

<snip>

.



Relevant Pages

  • Re: A basic question question about volatile use
    ... obviously for non-portable code it might be sufficient to just put in a comment in the code stating that you are relying on the compiler not putting in any padding. ... I was under the impression that if a struct contains only uint8_t and arrays thereof, there is no padding. ...
    (comp.lang.c)
  • Re: A basic question question about volatile use
    ... is obviously for non-portable code it might be sufficient to just ... put in a comment in the code stating that you are relying on the ... compiler not putting in any padding. ...
    (comp.lang.c)