title: warning: taking address of packed member of 'struct details' may result in an unaligned pointer value [-Waddress-of-packed-member]
body: <pre><code>       struct details_state {
                 struct details_status D1;
                 struct details_status D2;
         };
  
         struct details {
             struct details_state details_states[2];
         } __attribute__((packed));
  
  
          struct details *p;
  
          void print_details_status(struct details_status *s)
  
          print_details_status(&amp;(p-&gt;details_states[i].D1));
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  </code></pre>
  <p>warning: taking address of packed member of 'struct details' may result in an unaligned pointer value [-Waddress-of-packed-member]</p>
  <p>GCC gives this warning with &gt;9 version. How to get rid of this warning without using [-Wno-address-of-packed-member]</p>