title: UNION-type-punning error in IAR CSTAT Analyse
body: <p>I have a this type structure in example.h file like this:</p>
  <pre><code>typedef union{
  uint16_t valNum;
  struct{
  uint8_t valNumH;
  uint8_t valNumL;
  };
  } valueExp;
  </code></pre>
  <p>And I am using this structure in example.c file:</p>
  <pre><code>uint16_t myFunction(uint16_t tempData){
  uint8_t myData[8];
  ValueExp mainValue;
  mainValue.valNum=tempData;
  myData[5]=mainValue.valNumH;
  
  }
  </code></pre>
  <p>When I analyse IAR-CSTAT analyse this function I get this error:</p>
  <pre><code>Union mainValue is written as valNum then read as another field - UNION-type punning
  </code></pre>
  <p>How can I solve this message ?</p>