Warnings are issued when the compiler compiles the code and finds something unusual that should be brought to the attention of the programmer.
The compiler issues the “cast from integer to pointer of different size” warning whenever the value of an integer is converted to a pointer, especially when the memory allocated to a pointer is smaller than the memory allocated to an integer data type. For example, if the pointers in a system are stored in 16 bits, but integers are stored in 8 bits, a total of 8 bits would be lost in the given conversion. Hence, a warning is issued.
The following code shows this conversion:
int data = 999; // the integerint* pointer = &data; // the pointerpointer = data; // the conversion
Free Resources