Mercurial > vim
diff src/os_win32.c @ 29245:b12fd2b3be63 v8.2.5141
patch 8.2.5141: using "volatile int" in a signal handler might be wrong
Commit: https://github.com/vim/vim/commit/155f2d1451949d1124bfd6ba9c55be6bd74bab75
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 20 13:38:33 2022 +0100
patch 8.2.5141: using "volatile int" in a signal handler might be wrong
Problem: Using "volatile int" in a signal handler might be wrong.
Solution: Use "volatile sig_atomic_t".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 20 Jun 2022 14:45:03 +0200 |
parents | d6f8b784d0f6 |
children | 89e1d67814a9 |
line wrap: on
line diff
--- a/src/os_win32.c +++ b/src/os_win32.c @@ -8334,9 +8334,9 @@ static int timer_active = FALSE; * deleted. Ping-ponging between the two flags prevents this causing 'fake' * timeouts. */ -static int timeout_flags[2]; -static int timeout_flag_idx = 0; -static int *timeout_flag = &timeout_flags[0]; +static sig_atomic_t timeout_flags[2]; +static int timeout_flag_idx = 0; +static sig_atomic_t *timeout_flag = &timeout_flags[0]; static void CALLBACK @@ -8378,7 +8378,7 @@ stop_timeout(void) * This function is not expected to fail, but if it does it still returns a * valid flag pointer; the flag will remain stuck at zero. */ - volatile int * + volatile sig_atomic_t * start_timeout(long msec) { BOOL ret;