From: Yu Watanabe Date: Fri, 1 Aug 2025 04:37:11 +0000 (+0900) Subject: basic: do not use PROJECT_FILE in one more generated file X-Git-Tag: v258-rc2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfc8de2c7dcf88ad785057681c677c4c1a576421;p=thirdparty%2Fsystemd.git basic: do not use PROJECT_FILE in one more generated file Fixes the following build warning: ``` In file included from ../../../home/runner/work/systemd/systemd/src/basic/assert-util.h:4, from ../../../home/runner/work/systemd/systemd/src/basic/forward.h:17, from ../../../home/runner/work/systemd/systemd/src/basic/filesystems.h:4, from src/basic/filesystem-sets.c:2: src/basic/filesystem-sets.c: In function ‘fs_in_group’: ../../../home/runner/work/systemd/systemd/src/fundamental/assert-fundamental.h:76:9: warning: array subscript 42 is above array bounds of ‘const char[28]’ [-Warray-bounds=] 76 | log_assert_failed_unreachable(PROJECT_FILE, __LINE__, __func__) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/basic/filesystem-sets.c:559:18: note: in expansion of macro ‘assert_not_reached’ 559 | default: assert_not_reached(); | ^~~~~~~~~~~~~~~~~~ ``` Follow-up for aca4353ab2b928e669e1b649a9f6987df1efb084. Similar to fc4a9c9ce6eebbc472fc2947ae371f5925011545. --- diff --git a/src/basic/filesystem-sets.py b/src/basic/filesystem-sets.py index 7cf73aaefb8..6520f45b89e 100755 --- a/src/basic/filesystem-sets.py +++ b/src/basic/filesystem-sets.py @@ -282,6 +282,11 @@ def generate_fs_type_to_string(): #include #include "filesystems.h" +/* PROJECT_FILE, which is used by log_xyz() thus also used by assert_not_reached(), cannot be used in + * generated files, as the build directory may be outside of the source directory. */ +#undef PROJECT_FILE +#define PROJECT_FILE __FILE__ + const char* fs_type_to_string(statfs_f_type_t magic) { switch (magic) {""")