bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* term-style-control: fix gcc warning on mingw
@ 2019-04-27 13:23 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2019-04-27 13:23 UTC (permalink / raw)
  To: bug-gnulib

On mingw, I see this warning:

term-style-control.c: In function ‘ensure_other_signal_handlers’:
term-style-control.c:815:20: warning: unused variable ‘i’ [-Wunused-variable]
       unsigned int i;
                    ^

This patch fixes it.


2019-04-27  Bruno Haible  <bruno@clisp.org>

	term-style-control: Fix gcc warning on mingw.
	* lib/term-style-control.c (ensure_other_signal_handlers): Reduce scope
	of i.

diff -w --git a/lib/term-style-control.c b/lib/term-style-control.c
index 4d2b8ee..a22342c 100644
--- a/lib/term-style-control.c
+++ b/lib/term-style-control.c
@@ -812,14 +812,15 @@ ensure_other_signal_handlers (void)
 
   if (!signal_handlers_installed)
     {
-      unsigned int i;
-
       /* Install the handlers for the fatal signals.  */
       at_fatal_signal (fatal_signal_handler);
 
       #if defined SIGCONT
 
       /* Install the handlers for the stopping and continuing signals.  */
+      {
+        unsigned int i;
+
         for (i = 0; i < num_job_control_signals; i++)
           {
             int sig = job_control_signals[i];
@@ -847,6 +848,7 @@ ensure_other_signal_handlers (void)
               }
             #endif
           }
+      }
 
       #endif
 



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-27 13:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-27 13:23 term-style-control: fix gcc warning on mingw Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).