]> git.ipfire.org Git - thirdparty/coreutils.git/commit
build: avoid new chmod.c warnings from upcoming GCC12
authorJim Meyering <meyering@fb.com>
Thu, 16 Sep 2021 20:23:46 +0000 (13:23 -0700)
committerJim Meyering <meyering@fb.com>
Thu, 16 Sep 2021 22:22:15 +0000 (15:22 -0700)
commit3283cc7725bd7d070b772225b263e7f7718c8195
tree8f4a44cc21cecb9a791e8da65f124284129c7d25
parente6c57cf19b1e2660da1ceca92fc8837493cd157e
build: avoid new chmod.c warnings from upcoming GCC12

Here are the warnings:
src/chmod.c:175:3: error: 'ch.new_mode' may be used uninitialized in\
    this function [-Werror=maybe-uninitialized]
  175 |   strmode (ch->new_mode, perms);
src/chmod.c:178:3: error: 'ch.old_mode' may be used uninitialized in\
    this function [-Werror=maybe-uninitialized]
  178 |   strmode (ch->old_mode, old_perms);

* src/chmod.c (process_file): Initialize ch.  Its new_mode and
old_mode fields could indeed be used uninitialized to form mode
strings, but those are used only when built from initialized members.
src/chmod.c