* lib/quotearg.c (quotearg_buffer_restyled): Use switch (+E), and omit default case, to pacify gcc -Wswitch-enum. This is a good way to pacify -Wswitch-enum when we don’t want to enumerate all the enum values. Omit unnecessary ‘default: break;’s. --- ChangeLog | 6 ++++++ lib/quotearg.c | 11 +---------- 2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 2b02191a57..0d94556ba0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2025-02-02 Paul Eggert <egg...@cs.ucla.edu> + quotearg: pacify -Wswitch-enum + * lib/quotearg.c (quotearg_buffer_restyled): Use switch (+E), and + omit default case, to pacify gcc -Wswitch-enum. This is a good + way to pacify -Wswitch-enum when we don’t want to enumerate + all the enum values. Omit unnecessary ‘default: break;’s. + test-gettext-h: check call results * tests/test-gettext-h.c: Include string.h. (main): Check return values of calls. diff --git a/lib/quotearg.c b/lib/quotearg.c index d7b549e478..a31ea3d100 100644 --- a/lib/quotearg.c +++ b/lib/quotearg.c @@ -443,7 +443,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, break; case '?': - switch (quoting_style) + switch (+quoting_style) { case shell_always_quoting_style: if (elide_outer_quotes) @@ -469,14 +469,8 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, STORE ('"'); STORE ('?'); break; - - default: - break; } break; - - default: - break; } break; @@ -654,9 +648,6 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, case '[': case '\\': case '^': case '`': case '|': goto force_outer_quoting_style; - - default: - break; } } -- 2.45.2