title: C++, implicit truncation from 'int' to bit field
body: <p>I want to create a 64-bit data structure that each bit(s) should contain a value. for that, I have created a struct as follows. (this is related to <em>J1939 protocol and ControlApplication NAME</em> just in case)</p>
  
  <pre><code>typedef struct CA_NAME {
      unsigned  IdentityNumber : 21;          // 21 bits  Byte 1.1 to 3.5 
      unsigned  ManufactorerCode : 11;        // 11 bits  Byte 3.6 to 4.8 
      unsigned  ECUInstance : 3;              // 3  bits  Byte 5.1 to 5.3 
      unsigned  functionInstance : 5;         // 5  bits  Byte 5.4 to 5.8 
      unsigned  Function : 8;                 // 8  bits  Byte 6          
      unsigned  Reserved : 1;                 // 1  bit   Byte 7.1        
      unsigned  VehicleSystem : 7;            // 7  bits  Byte 7.2 to 7.8 
      unsigned  VehicleSystemInstance : 4;    // 4  bits  Byte 8.1 to 8.4 
      unsigned  IndustryGroup : 3;            // 3  bits  Byte 8.5 to 8.7 
      unsigned  ArbitraryAddressCapable : 1;  // 1  bit   Byte 8.8        
  } CA_NAME; /*64Bit NAME*/
  </code></pre>
  
  <p>now I want to initialize an object instance of <code>CA_NAME</code></p>
  
  <pre><code>CA_NAME j1939 = {};
  
  void Create_CA_NAME() {
      j1939.IdentityNumber = 0xFE0D32;
      j1939.ManufactorerCode = 0x57;
      ....
  }
  </code></pre>
  
  <p>Here I get realtime analysis error (I guess from ReSharper) that (i.e for the first assignment)
  <a href="https://i.stack.imgur.com/8oONN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8oONN.png" alt="enter image description here"></a></p>
  
  <p>What is the correct way of initializing an instance of the struct?</p>