Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 1/3] src: fix build warnings
- X-seq: zsh-workers 47784
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 1/3] src: fix build warnings
- Date: Wed, 30 Dec 2020 23:41:29 -0600
- Archived-at: <https://zsh.org/workers/47784>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-12/20201231054131.682544-2-felipe.contreras%40gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-ot1-f43.google.com) smtp.remote-ip=209.85.210.43; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Cc: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2to0qPagOVcOS0Q/49lX5gwKcCGUrWH3vfSoR2j/svk=; b=ZWDVl5Bi3gZphPeOwhkhUXyifU+VjlgdOmJrlG2zgctz6OV41Dfd1Asmjvma//czPS rWFLr2k55KXJYgc9k+BPMFy7AKNU6KbfEBOEcRi0Muw3NOKGqLuBoFbpk8KiGb6+WZGn EuH8UayRDbwV9pQGpiklTxOk6JBeisCadPzVnnv/2ZWEmjWskqDRgoPOHTYSK9ZU4oNc ZSzFOsxlVPPD+RiDn+bkI8tB6PrgyhjgHkC/cxtSFeAuXXNW3A3G629xEt+5bynhCQ5A wdy2hbfGql+DS3Pg2CEOt0uB624BAH7AWB7Mh4mvTdfY+hbxbpaZ1tNwLDCHBSBR6Thn NCHQ==
- In-reply-to: <20201231054131.682544-1-felipe.contreras@gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <20201231054131.682544-1-felipe.contreras@gmail.com>
- Sender: zsh-workers-request@xxxxxxx
pattern.c: In function ‘patcomppiece’:
pattern.c:1253:14: warning: ‘from’ may be used uninitialized in this function [-Wmaybe-uninitialized]
1253 | zrange_t from, to;
| ^~~~
utils.c: In function ‘getkeystring’:
cc1: warning: function may return address of local variable [-Wreturn-local-addr]
utils.c:6703:16: note: declared here
6703 | char *buf, tmp[1];
| ^~~
Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
Src/pattern.c | 2 +-
Src/utils.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Src/pattern.c b/Src/pattern.c
index c7c2c8bea..c28f2c9fb 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -1250,7 +1250,7 @@ patcomppiece(int *flagp, int paren)
int hash, count;
union upat up;
char *nptr, *str0, *ptr, *patprev;
- zrange_t from, to;
+ zrange_t from = 0, to;
char *charstart;
flags = 0;
diff --git a/Src/utils.c b/Src/utils.c
index 5151b89a8..37ae4c854 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -6700,7 +6700,8 @@ ucs4toutf8(char *dest, unsigned int wval)
mod_export char *
getkeystring(char *s, int *len, int how, int *misc)
{
- char *buf, tmp[1];
+ static char tmp[1];
+ char *buf;
char *t, *tdest = NULL, *u = NULL, *sstart = s, *tbuf = NULL;
char svchar = '\0';
int meta = 0, control = 0, ignoring = 0;
--
2.30.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author