journalctl: fix compile error on i386

Fixes the following error:
===
In file included from ../src/basic/macro.h:13,
                 from ../src/basic/dirent-util.h:8,
                 from ../src/journal/journalctl-misc.c:3:
../src/journal/journalctl-misc.c: In function 'show_log_ids':
../src/journal/journalctl-misc.c:107:22: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  107 |         assert(n_ids < INT64_MAX);
      |                      ^
../src/fundamental/macro-fundamental.h:70:44: note: in definition of macro '_unlikely_'
   70 | #define _unlikely_(x) (__builtin_expect(!!(x), 0))
      |                                            ^
../src/basic/macro.h:165:22: note: in expansion of macro 'assert_message_se'
  165 | #define assert(expr) assert_message_se(expr, #expr)
      |                      ^~~~~~~~~~~~~~~~~
../src/journal/journalctl-misc.c:107:9: note: in expansion of macro 'assert'
  107 |         assert(n_ids < INT64_MAX);
      |         ^~~~~~
cc1: all warnings being treated as errors
===

Follow-up for 0a8c1f6212.
This commit is contained in:
Yu Watanabe
2024-08-01 10:49:40 +02:00
committed by Luca Boccassi
parent 12a12c5af5
commit a8bc75089d
+1 -1
View File
@@ -104,7 +104,7 @@ static int show_log_ids(const LogId *ids, size_t n_ids, const char *name) {
assert(ids);
assert(n_ids > 0);
assert(n_ids < INT64_MAX);
assert((uint64_t) INT64_MAX - n_ids > 0);
assert(name);
table = table_new("idx", name, "first entry", "last entry");