# HG changeset patch # User Bram Moolenaar # Date 1643396404 -3600 # Node ID b63028cbe307df63d1c6a77672d77041e5dc82c7 # Parent d58f736a0429e3837b55613065d261a45ba23c96 patch 8.2.4244: MS-Windows: warning from MSVC on debug build Commit: https://github.com/vim/vim/commit/14cbf77845624e4bfc28a65a5debb81864cba2cf Author: K.Takata Date: Fri Jan 28 18:54:13 2022 +0000 patch 8.2.4244: MS-Windows: warning from MSVC on debug build Problem: MS-Windows: warning from MSVC on debug build. Solution: Adjust "/opt"o options. Remove unused variables. Make variables uppercase for consistency. (Ken Takata, closes #9647) diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -252,7 +252,7 @@ NODEBUG = 1 MAKEFLAGS_GVIMEXT = DEBUG=yes !endif -link = link +LINK = link # Check VC version. !if [echo MSVCVER=_MSC_VER> msvcver.c && $(CC) /EP msvcver.c > msvcver.~ 2> nul] @@ -1260,25 +1260,29 @@ LINK_PDB = /PDB:$(VIM).pdb -debug # CFLAGS with /Fo$(OUTDIR)/ CFLAGS_OUTDIR=$(CFLAGS) /Fo$(OUTDIR)/ -# Add /opt:ref to remove unreferenced functions and data even when /DEBUG is -# added. -conflags = /nologo /opt:ref - PATHDEF_SRC = $(OUTDIR)\pathdef.c -!IF "$(MAP)" == "yes" -# "/map" is for debugging -conflags = $(conflags) /map -!ELSEIF "$(MAP)" == "lines" -# "/mapinfo:lines" is for debugging, only works for VC6 and later -conflags = $(conflags) /map /mapinfo:lines -!ENDIF - -LINKARGS1 = $(linkdebug) $(conflags) +LINKARGS1 = /nologo LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) \ $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \ $(TCL_LIB) $(SOUND_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(SOD_LIB) $(LINK_PDB) +!ifdef NODEBUG +# Add /opt:ref to remove unreferenced functions and data even when /DEBUG is +# added. +LINKARGS1 = $(LINKARGS1) /opt:ref +!else +LINKARGS1 = $(LINKARGS1) /opt:noref /opt:noicf +!endif + +!if "$(MAP)" == "yes" +# "/map" is for debugging +LINKARGS1 = $(LINKARGS1) /map +!elseif "$(MAP)" == "lines" +# "/mapinfo:lines" is for debugging, only works for VC6 and later +LINKARGS1 = $(LINKARGS1) /map /mapinfo:lines +!endif + # Enable link time code generation if needed. !ifdef NODEBUG ! if "$(OPTIMIZE)" != "SPACE" @@ -1317,7 +1321,7 @@ all: $(MAIN_TARGET) \ GvimExt/gvimext.dll # To get around the command line limit: Make use of nmake's response files to -# capture the arguments for $(link) in a file using the @<=^^>) @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC) @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC) @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC) - @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC) + @echo char_u *all_lflags = (char_u *)"$(LINK:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC) @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC) @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4244, +/**/ 4243, /**/ 4242,