diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2026-06-15 02:08:14 +0200 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2026-06-16 10:39:58 +0200 |
| commit | 773b790570eea3b53864f4955eaeed6c5502d024 (patch) | |
| tree | 677db163ed0e44bd0c8c568bf968a818280c5781 | |
| parent | 54771: fix a bug in nosort deduplication (diff) | |
| download | zsh-773b790570eea3b53864f4955eaeed6c5502d024.tar zsh-773b790570eea3b53864f4955eaeed6c5502d024.tar.gz zsh-773b790570eea3b53864f4955eaeed6c5502d024.tar.bz2 zsh-773b790570eea3b53864f4955eaeed6c5502d024.tar.lz zsh-773b790570eea3b53864f4955eaeed6c5502d024.tar.xz zsh-773b790570eea3b53864f4955eaeed6c5502d024.tar.zst zsh-773b790570eea3b53864f4955eaeed6c5502d024.zip | |
54776: fix warnings from 54710
Some compilers warn if a label immediately precedes a variable declaration.
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | Src/Modules/system.c | 4 | ||||
| -rw-r--r-- | Src/Modules/zftp.c | 12 | ||||
| -rw-r--r-- | Src/Zle/complete.c | 12 | ||||
| -rw-r--r-- | Src/exec.c | 20 | ||||
| -rw-r--r-- | Src/glob.c | 12 |
6 files changed, 38 insertions, 26 deletions
@@ -1,5 +1,9 @@ 2026-06-16 Mikael Magnusson <mikachu@gmail.com> + * 54776: Src/Modules/system.c, Src/Modules/zftp.c, + Src/Zle/complete.c, Src/exec.c, Src/glob.c: fix warnings from + 54710 + * 54771: Src/Zle/compcore.c, Test/Y01completion.ztst: fix a bug in nosort deduplication diff --git a/Src/Modules/system.c b/Src/Modules/system.c index 4d2f8c42a..57daf0d87 100644 --- a/Src/Modules/system.c +++ b/Src/Modules/system.c @@ -556,7 +556,7 @@ bin_zsystem_flock(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) #endif while (*args && **args == '-') { - int opt; + convchar_t opt; char *optptr = *args + 1, *optarg; args++; if (!*optptr || !strcmp(optptr, "-")) @@ -653,7 +653,7 @@ bin_zsystem_flock(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) break; default: - convchar_t opt = unmeta_one(optptr, NULL); + opt = unmeta_one(optptr, NULL); zwarnnam(nam, "flock: bad option: %c", opt); return 1; } diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c index f863676c1..738b22b43 100644 --- a/Src/Modules/zftp.c +++ b/Src/Modules/zftp.c @@ -3093,11 +3093,13 @@ bin_zftp(char *name, char **args, UNUSED(Options ops), UNUSED(int func)) break; default: - int sz; - convchar_t p = unmeta_one(ptr, &sz); - ptr += sz - 1; - zwarnnam(name, "preference %c not recognized", p); - break; + { + int sz; + convchar_t p = unmeta_one(ptr, &sz); + ptr += sz - 1; + zwarnnam(name, "preference %c not recognized", p); + break; + } } } } diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c index b8e203b80..28d62efea 100644 --- a/Src/Zle/complete.c +++ b/Src/Zle/complete.c @@ -797,11 +797,13 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) argv++; goto ca_args; default: - convchar_t c = unmeta_one(p, NULL); - zwarnnam(name, "bad option: -%c", c); - zsfree(mstr); - zfree(dat.dpar, dparsize); - return 1; + { + convchar_t c = unmeta_one(p, NULL); + zwarnnam(name, "bad option: -%c", c); + zsfree(mstr); + zfree(dat.dpar, dparsize); + return 1; + } } if (sp) { if (p[1]) { diff --git a/Src/exec.c b/Src/exec.c index f7249f551..17899262d 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -3300,15 +3300,17 @@ execcmd_exec(Estate state, Execcmd_params eparams, cflags |= BINF_DASH; break; default: - convchar_t opt = unmeta_one(cmdopt, NULL); - zerr("unknown exec flag -%c", opt); - lastval = 1; - errflag |= ERRFLAG_ERROR; - if (forked) - _realexit(); - if (how & Z_TIMED) - shelltime(&shti, &chti, &then, 1); - return; + { + convchar_t opt = unmeta_one(cmdopt, NULL); + zerr("unknown exec flag -%c", opt); + lastval = 1; + errflag |= ERRFLAG_ERROR; + if (forked) + _realexit(); + if (how & Z_TIMED) + shelltime(&shti, &chti, &then, 1); + return; + } } } if (!argnode) diff --git a/Src/glob.c b/Src/glob.c index b9f722378..0b516d226 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -1755,11 +1755,13 @@ zglob(LinkList list, LinkNode np, int nountok) break; } default: - untokenize(--s); - convchar_t attr = unmeta_one(s, NULL); - zerr("unknown file attribute: %c", attr); - restore_globstate(saved); - return; + { + untokenize(--s); + convchar_t attr = unmeta_one(s, NULL); + zerr("unknown file attribute: %c", attr); + restore_globstate(saved); + return; + } } } if (func) { |
