I saw an occurance of /* NOTREACHED */ while looking at the tsort
command.

IIRC this was a comment that was recognized by the 'lint' program. The
BSD people still use it nowadays per style(9), but unreachable () is
more useful to catch bugs.

Pushed since it is obvious.

Collin

>From 7d55fd0aa3f171163a7bd6e7fc774e6acdafc52a Mon Sep 17 00:00:00 2001
Message-ID: <7d55fd0aa3f171163a7bd6e7fc774e6acdafc52a.1759387707.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Wed, 1 Oct 2025 23:44:18 -0700
Subject: [PATCH] maint: prefer unreachable () to NOTREACHED comment

* src/tsort.c (search_item): Use unreachable () instead of NOTREACHED.
---
 src/tsort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tsort.c b/src/tsort.c
index 7aff3e29a..6e39c0d13 100644
--- a/src/tsort.c
+++ b/src/tsort.c
@@ -255,7 +255,7 @@ search_item (struct item *root, char const *str)
       p = q;
     }
 
-  /* NOTREACHED */
+  unreachable ();
 }
 
 /* Record the fact that J precedes K.  */
-- 
2.51.0

Reply via email to