Skip to content

Commit 1ea8a3c

Browse files
dschoGit for Windows Build Agent
authored andcommitted
fixup??? bugreport: add compiler info
As documented at https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2019, `_MSC_FULL_VER` is an integer, not a string. Therefore this fix is needed to prevent a segmentation fault in the test t0091.1. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 6dfbeea commit 1ea8a3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compat/compiler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ static inline void get_compiler_info(struct strbuf *info)
1616
#endif
1717

1818
#ifdef _MSC_VER
19-
strbuf_addf(info, "MSVC version: %s\n", _MSC_FULL_VER);
19+
strbuf_addf(info, "MSVC version: %02d.%02d.%05d\n",
20+
_MSC_VER / 100, _MSC_VER % 100, _MSC_FULL_VER % 100000);
2021
#endif
2122

2223
if (len == info->len)

0 commit comments

Comments
 (0)