From: Paul Eggert Date: Sat, 20 Jul 2013 14:21:25 +0000 (-0700) Subject: * lread.c (Fload): Avoid initialization only when lint checking. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1758 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b2a069c2f80cb2fdd683f5e044642b058c4d2326;p=emacs.git * lread.c (Fload): Avoid initialization only when lint checking. Mention that it's needed only for older GCCs. --- diff --git a/src/ChangeLog b/src/ChangeLog index 5f3a48cbe88..c88951f9422 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-07-20 Paul Eggert + + * lread.c (Fload): Avoid initialization only when lint checking. + Mention that it's needed only for older GCCs. + 2013-07-20 Kenichi Handa * coding.c (CODING_ISO_FLAG_LEVEL_4): New macro. diff --git a/src/lread.c b/src/lread.c index e701338da31..57c7df74127 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1044,7 +1044,7 @@ Return t if the file exists and loads successfully. */) { FILE *stream; int fd; - int fd_index = 0; + int fd_index; ptrdiff_t count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2, gcpro3; Lisp_Object found, efound, hist_file_name; @@ -1175,7 +1175,12 @@ Return t if the file exists and loads successfully. */) #endif } - if (fd >= 0) + if (fd < 0) + { + /* Pacify older GCC with --enable-gcc-warnings. */ + IF_LINT (fd_index = 0); + } + else { fd_index = SPECPDL_INDEX (); record_unwind_protect_int (close_file_unwind, fd);