]> git.ipfire.org Git - thirdparty/systemd.git/commit
bless-boot: avoid false maybe-uninitialized warning 42843/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 2 Jul 2026 08:31:38 +0000 (17:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 2 Jul 2026 18:02:57 +0000 (03:02 +0900)
commitd04423c870a7b62f376e26ce7a4bc48d2370f423
tree17f0b7fa27e3b66eb584d0fa391c83bb05a7060e
parent4bf6e751984db9bf35a516a4177bb5b3493989dc
bless-boot: avoid false maybe-uninitialized warning

Obserbed with GCC-11 on Ubuntu.
```
In file included from ../src/shared/format-table.h:7,
                 from ../src/bless-boot/bless-boot.c:11:
../src/bless-boot/bless-boot.c: In function ‘verb_set’:
../src/basic/log.h:187:27: error: ‘source2’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  187 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                           ^~~~~~~~~~~~
../src/bless-boot/bless-boot.c:458:40: note: ‘source2’ was declared here
  458 |         const char *target, *source1, *source2;
      |                                        ^~~~~~~
In file included from ../src/shared/format-table.h:7,
                 from ../src/bless-boot/bless-boot.c:11:
../src/basic/log.h:187:27: error: ‘source1’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  187 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                           ^~~~~~~~~~~~
../src/bless-boot/bless-boot.c:458:30: note: ‘source1’ was declared here
  458 |         const char *target, *source1, *source2;
      |                              ^~~~~~~
In file included from ../src/shared/format-table.h:7,
                 from ../src/bless-boot/bless-boot.c:11:
../src/basic/log.h:187:27: error: ‘target’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  187 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                           ^~~~~~~~~~~~
../src/bless-boot/bless-boot.c:458:21: note: ‘target’ was declared here
  458 |         const char *target, *source1, *source2;
      |                     ^~~~~~
cc1: all warnings being treated as errors
```
src/bless-boot/bless-boot.c