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

[PATCH 2/2] reflog: rename unreachable

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Nov 17, 2024, 01:31 UTC
Message-ID
<20241117013149.576671-3-sandals@crustytoothpaste.net>
In-Reply-To
<20241117013149.576671-1-sandals@crustytoothpaste.net>

In C23, "unreachable" is a macro that invokes undefined behavior if it is invoked. To make sure that our code compiles on a variety of C versions, rename unreachable to "is_unreachable".

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 reflog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/reflog.c b/reflog.c
index 875ac1aa66..aeab78c9b7 100644
--- a/reflog.c
+++ b/reflog.c
@@ -210,7 +210,7 @@ static void mark_reachable(struct expire_reflog_policy_cb *cb)
 	cb->mark_list = leftover;
 }
 
-static int unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit, struct object_id *oid)
+static int is_unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit, struct object_id *oid)
 {
 	/*
 	 * We may or may not have the commit yet - if not, look it
@@ -265,7 +265,7 @@ int should_expire_reflog_ent(struct object_id *ooid, struct object_id *noid,
 			return 1;
 		case UE_NORMAL:
 		case UE_HEAD:
-			if (unreachable(cb, old_commit, ooid) || unreachable(cb, new_commit, noid))
+			if (is_unreachable(cb, old_commit, ooid) || is_unreachable(cb, new_commit, noid))
 				return 1;
 			break;
 		}
Previous: brian m. carlsonNext: brian m. carlson
Message 3 of 8 in “Build failure with -std=gnu23 (GCC 15 default)”
  1. Sam JamesNov 16, 2024
  2. 0/2 C23 compatibilitybrian m. carlson, Nov 17, 2024
  3. 2/2 reflog: rename unreachablebrian m. carlson, Nov 17, 2024
  4. 1/2 index-pack: rename struct thread_localbrian m. carlson, Nov 17, 2024
  5. Sam JamesNov 17, 2024
  6. Patrick SteinhardtNov 18, 2024
  7. Jeff KingNov 18, 2024
  8. brian m. carlsonNov 18, 2024

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.