]> git.pond.sub.org Git - empserver/commit
load tend: Avoid "may be used uninitialized" warnings
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Jan 2021 07:47:22 +0000 (08:47 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 6 Feb 2021 15:55:37 +0000 (16:55 +0100)
commit1f6b79dd10c841d99d8cf5e94528edb45af19592
tree650cfe765e2c8a74889f0f47947ac42b4d9e5c1e
parentb770ac4ba82d742713ec4f39e50efa7e8a3005f2
load tend: Avoid "may be used uninitialized" warnings

c_load() initializes @ich only when @type is EF_SECTOR.  It also uses
it only then.  Clang is cool with this, but GCC gets confused and
warns "‘ich’ may be used uninitialized".  Ron Koenderink reports
Visual Studio 2019 even flags it as an error.  Same for c_lload() and
c_tend().

Time to clean this up.  Rearrange the code to avoid the warning and
also improve readability a bit.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/load.c
src/lib/commands/tend.c