build: suppress -Wmaybe-uninitialized for one function

* src/sdiff.c (edit): Suppress gcc's -Wmaybe-uninitialized warning
for this function. Whenever "cmd1 == 'e'", cmd2 **is** initialized.
This commit is contained in:
Jim Meyering 2024-01-05 08:58:10 -08:00
parent 774b942f70
commit f1a8c476b6

View File

@ -842,6 +842,12 @@ flush_line (void)
perror_fatal (_("read failed"));
}
/* Suppress gcc's "...may be used before initialized" warnings,
generated by GCC versions up to at least GCC 14.0.0 20231227. */
#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
/* interpret an edit command */
static bool
@ -1041,7 +1047,11 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
}
}
}
#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4
# pragma GCC diagnostic pop
#endif
/* Alternately reveal bursts of diff output and handle user commands. */
static bool
interact (struct line_filter *diff,