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 aca4353ab2.
Similar to fc4a9c9ce6.
This commit is contained in:
Yu Watanabe
2025-08-01 09:49:23 +01:00
committed by Luca Boccassi
parent 24b27a0000
commit dfc8de2c7d
+5
View File
@@ -282,6 +282,11 @@ def generate_fs_type_to_string():
#include <linux/magic.h>
#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) {""")