1 Commits

Author SHA1 Message Date
Xibo.Wang
fbf3f4b4d7 maint: avoid warnings from GCC8
backport from https://git.savannah.gnu.org/gitweb/?p=patch.git;a=commit;h=ae81be0

I configured with --enable-gcc-warnings and bleeding-edge gcc
(version 8.0.1 20180406) and hit some warning-escalated-to-errors.
This fixes them:
* src/common.h (FALLTHROUGH): Define.
* src/patch.c (abort_hunk_context): Use FALLTHROUGH macro in place of
a comment.  This avoids a warning from -Wimplicit-fallthrough=.
* src/pch.c (do_ed_script): Add otherwise unnecessary initialization
to avoid warning from -Wmaybe-uninitialized.
(another_hunk): Use FALLTHROUGH macro here, too, twice.

Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn>
2022-12-29 17:05:05 +08:00