Skip to content

Commit

Permalink
Initialize n to 0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Paulo Matos committed Sep 26, 2019
1 parent ed4b7cf commit 5e3cfac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions LOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion c/scheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5e3cfac

Please sign in to comment.