The assertion MUSTALIAS(m, n) in basic_c_test\CI-funptr.c should be MAYALIAS only?
taquangtrung opened this issue · comments
Ta Quang Trung commented
Hi,
For this example, I think that in the first call to f
, we have pa = &a
and pb = &b
, hence pa
and pb
are not aliases.
Therefore, the MUSTALIAS assertion inside f
doesn't hold for the first call to f
.
Could you advise if it should be changed to MAYALIAS?
Thank you!
#include "aliascheck.h"
void f(int *m, int *n)
{
MUSTALIAS(m, n);
}
typedef void (*fp)(int*m, int*n);
int main()
{
int a,b,c,d;
int *pa, *pb;
fp p;
pa = &a, pb = &b;
f(pa, pb); // pa and pb are not alias in this call.
p = f;
pb = &a;
(*p)(pa, pb);
return 0;
}
Yulei Sui commented
Done, thanks