git-commit-vandalism/compat/win32
Derrick Stolee b4f52f09ae compat/win32: correct for incorrect compiler warning
The 'win build' job of our CI build is failing with the following error:

compat/win32/syslog.c: In function 'syslog':
compat/win32/syslog.c:53:17: error: pointer 'pos' may be used after \
				    'realloc' [-Werror=use-after-free]
   53 |                 memmove(pos + 2, pos + 1, strlen(pos));
    CC compat/poll/poll.o
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compat/win32/syslog.c:47:23: note: call to 'realloc' here
   47 |                 str = realloc(str, st_add(++str_len, 1));
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

However, between this realloc() and the use we have a line that resets
the value of 'pos'. Thus, this error is incorrect. It is likely due to a
new version of the compiler on the CI machines.

Instead of waiting for a new compiler, create a new variable to avoid
this error.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-19 12:51:34 -07:00
..
alloca.h mingw: activate alloca 2014-04-09 10:08:35 -07:00
dirent.c Win32: Unicode file name support (dirent) 2014-07-15 11:19:09 -07:00
dirent.h Win32: Unicode file name support (dirent) 2014-07-15 11:19:09 -07:00
flush.c core.fsyncmethod: add writeout-only mode 2022-03-10 15:10:22 -08:00
git.manifest mingw: embed a manifest to trick UAC into Doing The Right Thing 2019-06-27 12:55:45 -07:00
lazyload.h lazyload: use correct calling conventions 2022-01-09 10:34:53 -08:00
path-utils.c Sync with 2.20.2 2019-12-06 16:31:12 +01:00
path-utils.h dir API: add a generalized path_match_flags() function 2022-05-16 15:02:09 -07:00
pthread.c win32: replace pthread_cond_*() with much simpler code 2018-11-14 15:14:22 +09:00
pthread.h pthread.h: manually align parameter lists 2019-10-11 14:59:35 +09:00
syslog.c compat/win32: correct for incorrect compiler warning 2022-07-19 12:51:34 -07:00
syslog.h mingw: implement syslog 2010-11-04 16:53:49 -07:00
trace2_win32_process_info.c lazyload: use correct calling conventions 2022-01-09 10:34:53 -08:00