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;
}
Hi,
For this example, I think that in the first call to
f
, we havepa = &a
andpb = &b
, hencepa
andpb
are not aliases. Therefore, the MUSTALIAS assertion insidef
doesn't hold for the first call tof
.Could you advise if it should be changed to MAYALIAS?
Thank you!