Re: [PATCH v1] Travis: also test on 32-bit Linux
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 10, 2017, 23:33 UTC
- Message-ID
- <xmqqr324wvum.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <c93a61a4-05d9-8e49-9734-12c81289517b@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 5 quoted lines
> @ depends on r @ > expression E; > @@ > - *& > E
I guess my source of the confusion is that the tool that understands the semantics of the C language still needs to be told about that.
I was hoping that something that understands C only needs to be told only a single rule:
type T T src, dst
-memcpy(&dst, &src, sizeof(dst)); +dst = src;
and then can apply that rule to this code in four ways:
struct foo A, *Bp;
memcpy(Bp, &A, sizeof(*Bp)); memcpy(Bp, &A, sizeof(A)); memcpy(&src, dstp, sizeof(A)); memcpy(&src, dstp, sizeof(*Bp));
to obtain its rewrite:
struct foo A, *Bp;
*Bp = A; *Bp = A; A = *Bp; A = *Bp;
by knowing that (*Bp) is of type "struct foo" (even though Bp is of type "struct foo *") and sizeof(dst) and sizeof(src) are the same thing in the rule because src and dst are both of type T.