From d12b818af736108360a4ca1a785fe14701cc64cd Mon Sep 17 00:00:00 2001 From: Karsten Blees Date: Fri, 7 Jan 2011 14:41:39 +0100 Subject: [PATCH] MSVC: disable frequent compiler warnings Using uninitialized variables to initialize themselves (i.e. 'type varname = varname;') seems to be a frequent pattern in git. This is supposedly to suppress the 'using uninitialized variable' warning, which is a bit paradox, but seems to work with most compilers. MSVC correctly complains here - disable C4090 warning. MSVC also warns about implicit casts from non-const to const, which is stupid - disable C4700 warning. MSVC link.exe doesn't recognize the /wd option in CFLAGS in the Makefile, so use #pragma warning in central, MSVC-specific unistd.h. Signed-off-by: Karsten Blees --- compat/vcbuild/include/unistd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h index b14fcf94da..20c369fca0 100644 --- a/compat/vcbuild/include/unistd.h +++ b/compat/vcbuild/include/unistd.h @@ -3,6 +3,8 @@ /* Win32 define for porting git*/ +#pragma warning(disable : 4090 4700) + #ifndef _MODE_T_ #define _MODE_T_ typedef unsigned short _mode_t; -- 2.11.4.GIT