What does the warning "(752) Conversion to shorter data type" mean?

The “Conversion to shorter data type” warning occurs in an expression where the lvalue (left-value) is of a shorter type than the rvalue (right-value). The warning is about this conversion of data to a shorter type.

Here are a few examples that might help you understand why it occurs in your code:

Example 1:

Example 2:

buffTail is a defined as type uint8_t.
In the expression buffSize-1, the constant 1 will be treated as an int type, and the resultant expression too will have type int.
In the expression buffTail &= (buffSize-1) as the lvalue is of shorter type (uint8_t) than the rvalue (int), the conversion to shorter data type warning will be triggered.

Example 3:

Constant values are treated as type int. The resultant of the expression 0xFF - cycleCount will be of int type. Since, the lvalue (i.e. TMR0) is of shorter type (volatile unsigned char) than the rvalue (int), the conversion to shorter data type warning will be triggered.

Example 4:

The resultant value of the expression (BAUD9600»8) is of int type. Since, BAUD9600 is a constant the resultant value of the expression will also be int type. Assigning an int type to a char type (SPBRGL), will result in the conversion to shorter data type warning.

We recommend you review all compiler warnings before testing or utilizing your code.
However, if you want to suppress this warning, you can do so by using the option --MSGDISABLE=752.
Under MPLAB X IDE Project Properties > XC8 global options > Additional options: <specify the option in the dialog box>
--MSGDISABLE=752

© 2017 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.