title: Volatile Struct Semantics
body: <p>Is it sufficient to declare an instance of a structure-typed variable as volatile (if its fields are accessed in re-entrant code), or must one declare specific fields of the structure as volatile?</p>
  
  <p>Phrased differently, what are the semantic differences (if any) between:</p>
  
  <pre><code>typdef struct {
    uint8_t bar;
  } foo_t;
  
  volatile foo_t foo_inst;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>typedef struct{
    volatile uint8_t bar;
  } foo_t;
  
  foo_t foo_inst;
  </code></pre>
  
  <p>I recognize that declaring a pointer-typed variable as volatile (e.g. volatile uint8_t * foo) merely informs the compiler that the address pointed-to by foo may change, while making no statement about the values pointed to by foo. It is unclear to me whether an analogy holds for structure-typed variables.</p>