From f8762d6cbb5035a1f3738f72558be072f59a847a Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Wed, 18 Sep 2019 11:03:50 +0200 Subject: [PATCH] Initialize n to 0 gcc 9.1.0 fails to compile with -Werror and -O3 because it detects that `n` might be used uninitialize in line `if (n != scheme_version) {` We do know that `n` will be initialized in `if (zget_uptr(file, &n) != 0) {` but gcc doesn't know that unless compiled with LTO. original commit: 5e3cfac1e0fa85688ec3f369f2ab0f464d3270ab --- LOG | 2 ++ c/scheme.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/LOG b/LOG index 19111aed18..4da697e9ce 100644 --- a/LOG +++ b/LOG @@ -1759,3 +1759,5 @@ - used with-object-file to restore accidentally dropped close-port in compile-whole-program and compile-whole-library compile.ss +- initialized variable to enable compilation with 9.1.0 at -O3 + c/scheme.c diff --git a/c/scheme.c b/c/scheme.c index cc9e5a65aa..a21074c7df 100644 --- a/c/scheme.c +++ b/c/scheme.c @@ -572,7 +572,8 @@ static void check_boot_file_state PROTO((const char *who)); static IBOOL find_boot(name, ext, fd, errorp) const char *name, *ext; int fd; IBOOL errorp; { char pathbuf[PATH_MAX], buf[PATH_MAX]; - uptr n; INT c; + uptr n = 0; + INT c; const char *path; #ifdef WIN32 wchar_t *expandedpath;