git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: René ScharfeNext: René Scharfe
Message 32 of 36 in “Travis: also test on 32-bit Linux”
  1. Travis: also test on 32-bit LinuxJohannes Schindelin, Feb 28, 2017
  2. Johannes SchindelinFeb 28, 2017
  3. Junio C HamanoMar 2, 2017
  4. Travis: also test on 32-bit LinuxLars Schneider, Mar 2, 2017
  5. Johannes SchindelinMar 2, 2017
  6. Lars SchneiderMar 2, 2017
  7. Johannes SchindelinMar 2, 2017
  8. Christian CouderMar 2, 2017
  9. Junio C HamanoMar 2, 2017
  10. Johannes SchindelinMar 3, 2017
  11. Junio C HamanoMar 3, 2017
  12. Junio C HamanoMar 4, 2017
  13. Junio C HamanoMar 4, 2017
  14. Lars SchneiderMar 4, 2017
  15. Vegard NossumMar 4, 2017
  16. Vegard NossumMar 4, 2017
  17. Vegard NossumMar 4, 2017
  18. Jeff KingMar 5, 2017
  19. line-log: use COPY_ARRAY to fix mis-sized memcpyJeff King, Mar 5, 2017
  20. Vegard NossumMar 5, 2017
  21. Jeff KingMar 5, 2017
  22. René ScharfeMar 10, 2017
  23. Jeff KingMar 10, 2017
  24. René ScharfeMar 10, 2017
  25. Jeff KingMar 10, 2017
  26. René ScharfeMar 10, 2017
  27. Jeff KingMar 10, 2017
  28. René ScharfeMar 10, 2017
  29. Junio C HamanoMar 10, 2017
  30. Jeff KingMar 10, 2017
  31. René ScharfeMar 10, 2017
  32. Junio C HamanoMar 10, 2017
  33. René ScharfeMar 11, 2017
  34. Ramsay JonesMar 2, 2017
  35. Lars SchneiderMar 5, 2017
  36. Ramsay JonesMar 5, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.