From 04499a70fbff3f6b798028473f5c9234a53eaa2d Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 27 Jul 2021 12:27:28 +0200 Subject: Drop the text argument from assert_not_reached() In general we almost never hit those asserts in production code, so users see them very rarely, if ever. But either way, we just need something that users can pass to the developers. We have quite a few of those asserts, and some have fairly nice messages, but many are like "WTF?" or "???" or "unexpected something". The error that is printed includes the file location, and function name. In almost all functions there's at most one assert, so the function name alone is enough to identify the failure for a developer. So we don't get much extra from the message, and we might just as well drop them. Dropping them makes our code a tiny bit smaller, and most importantly, improves development experience by making it easy to insert such an assert in the code without thinking how to phrase the argument. --- src/udev/cdrom_id/cdrom_id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/udev/cdrom_id') diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c index df0ee6a3bb..a2185350d3 100644 --- a/src/udev/cdrom_id/cdrom_id.c +++ b/src/udev/cdrom_id/cdrom_id.c @@ -943,7 +943,7 @@ static int parse_argv(int argc, char *argv[]) { case 'h': return help(); default: - assert_not_reached("Unknown option"); + assert_not_reached(); } arg_node = argv[optind]; -- cgit v1.2.3