mcst-linux-kernel/patches-2024.06.26/busybox-1.26.2/0009-LCC-uninitialized-vari...

37 lines
1.0 KiB
Diff

Date: Wed, 10 Nov 2021 21:35:35 +0300
Subject: [PATCH] Uninitialized variables detected with LCC
Tags: e2k busybox build
diff --git a/archival/unzip.c b/archival/unzip.c
index c540485..dcc2f64 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -357,7 +357,11 @@ int unzip_main(int argc, char **argv)
llist_t *zaccept = NULL;
llist_t *zreject = NULL;
char *base_dir = NULL;
+#ifdef __LCC__
+ int i = 0, opt;
+#else /* __LCC__ */
int i, opt;
+#endif /* __LCC__ */
char key_buf[80]; /* must match size used by my_fgets80 */
struct stat stat_buf;
diff --git a/miscutils/less.c b/miscutils/less.c
index e90691b..3229bc2 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -742,7 +742,11 @@ static const char ctrlconv[] ALIGN1 =
static void print_lineno(const char *line)
{
const char *fmt = " ";
+#ifndef __LCC__
unsigned n = n; /* for compiler */
+#else /* __LCC__ */
+ unsigned n = 0; /* must be initialized somehow */
+#endif /* __LCC__ */
if (line != empty_line_marker) {
/* Width of 7 preserves tab spacing in the text */