title: How to declare packed struct (without padding) for LLVM?
body: <p>It's possible to tell GCC it should not use padding for the struct. This is done using <code>__attribute__((packed))</code>. </p>
  
  <pre><code>typedef struct {
  
    uint8_t startSymbol;
    uint8_t packetType;
    uint32_t deviceId;
    uint16_t packetCRC;
  
  } PacketData __attribute__((packed));
  </code></pre>
  
  <p>However, newest Xcode uses LLVM and does not recognize the attribute.  How to define packed struct for LLVM? </p>
  
  <p>The full description of the problem might be found <a href="https://stackoverflow.com/questions/13687981/union-struct-printing-struct-member-of-type-uint32-t-skips-two-bytes-and-prints/13688246#13688246">here</a></p>
  
  <p><strong>UPDATE</strong>  I'm using Xcode 4.5.1 for iOS which uses Apple LLVM 4.1 compiler. I'm getting "'packed' attribute ignored" warning in Xcode in the code example above. </p>