Default Argument Promotion


Default Argument Promotion describes the process by which function arguments of type char, short and float are sometimes promoted when passed to a function. This occurs when the compiler is unable to make any assumptions about the type of the corresponding parameter in the receiving function, as in the following situations:

When default argument promotion is applied, arguments of type char or short are converted to type int or unsigned int according to the rules of Integral Promotion; arguments of type float are converted to type double. The promoted type of an argument is required to be consistent with the promoted type of the corresponding parameter in the function definition; so, for example, it is legitimate to pass an argument of type float when the receiving parameter is of type double.

Index