Note the use of the c language a bit field - data overflow

c language may use variable bit fields to save space, for example, a switch power on and off only two states, 0 and 1 is sufficient to use, that is with a binary. The range of bit field is very limited, slightly larger data overflow occurs, the word that use the keil, keil tips, overflow warning

We can not ignore any warning keil, otherwise data overflow, the function of your code can not be completed.

Pack struct
{
unsigned A: 12 is;  
unsigned: 20 is; // not a member of the bit field used for filling
unsigned C:. 6;  
};

 

Another can be used to fill, because of the reasons memory alignment.

Guess you like

Origin www.cnblogs.com/CodeWorkerLiMing/p/12044370.html