M
Mark
Hello
void func(unsigned long);
void func(unsigned long i)
{
return;
}
int main(void)
{
int p = 10, k = -7;
double t = 1.9;
func(p); /* case 1 */
func(k); /* case 2 */
func(t); /* case 3 */
return 0;
}
Am I right, that case 2 and 3 invoke undefined behavior? Back up quote form
the Standard, 6.5.2.2p9: "If the function is defined with a type that is not
compatible with the type (of the expression) pointed to by the expression
that denotes the called function, the behavior is undefined."
If I'm wrong, what does the Standard say about the situations above ?
Thanks.
void func(unsigned long);
void func(unsigned long i)
{
return;
}
int main(void)
{
int p = 10, k = -7;
double t = 1.9;
func(p); /* case 1 */
func(k); /* case 2 */
func(t); /* case 3 */
return 0;
}
Am I right, that case 2 and 3 invoke undefined behavior? Back up quote form
the Standard, 6.5.2.2p9: "If the function is defined with a type that is not
compatible with the type (of the expression) pointed to by the expression
that denotes the called function, the behavior is undefined."
If I'm wrong, what does the Standard say about the situations above ?
Thanks.