John Marriott wrote:
> On 03-Sep-2019 07:50, Yegappan Lakshmanan wrote: > > Hi, > > > > On Mon, Sep 2, 2019 at 1:47 PM John Marriott <[email protected]> > > wrote: > >> On 03-Sep-2019 06:32, Bram Moolenaar wrote: > >>> Patch 8.1.1966 > >>> Problem: Some code in options.c fits better elsewhere. > >>> Solution: Move functions from options.c to other files. (Yegappan > >>> Lakshmanan, closes #4889) > >>> Files: src/evalfunc.c, src/globals.h, src/indent.c, src/map.c, > >>> src/option.c, src/proto/map.pro, src/proto/option.pro, > >>> src/proto/quickfix.pro, src/proto/screen.pro, > >>> src/proto/spell.pro, > >>> src/proto/window.pro, src/quickfix.c, src/screen.c, > >>> src/spell.c, > >>> src/window.c > >> After this patch, gcc (mingw) throws these errors: > >> > > I built Vim 8.1.1967 using mingw-w64 GCC on MS-Windows without these errors. > > Can you make sure that the changes to the src/quickfix.c and > > src/proto/quickfix.pro > > files are present in your view? > > > > - Yegappan > > I use git to keep the sources up to date. I downloaded the tar.gz > archive and got the same result. I am happy that the files were updated > correctly. > > It turns out that I have both FEAT_QUICKFIX and FEAT_TEXT_PROP (amongst > other things) disabled for this build. The attached patches > "8.1.1966.quickfix.pro.patch" and "8.1.1966.evalfunc.pro.patch" fixes > the error for me. That's not the right fix, it would be undone by the next proto update. I'll remove the #ifdef in proto.h and check that works. > I tried some experimentation. If I have FEAT_QUICKFIX enabled, but > FEAT_TEXT_PROP disabled, I get a warning and a couple of errors. > > The warning: > > gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 > -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_MSWIN > -DFEAT_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer > -freg-struct-return buffer.c -o gobjnative/buffer.o > buffer.c:5507:1: warning: 'find_win_for_buf' defined but not used > [-Wunused-function] > 5507 | find_win_for_buf( > | ^~~~~~~~~~~~~~~~ > > The attached patch "8.1.1966.buffer.c.patch" tries to fix this. That #ifdef is already there. But it's not right. > The first error: > > gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 > -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_MSWIN > -DFEAT_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer > -freg-struct-return popupmnu.c -o gobjnative/popupmnu.o > popupmnu.c: In function 'pum_set_selected': > popupmnu.c:763:6: error: 'has_info' undeclared (first use in this > function); did you mean 'hash_init'? > 763 | has_info = TRUE; > | ^~~~~~~~ > | hash_init > > The attached patch "8.1.1966.popupmnu.c.patch" tries to fix this. That #ifdef is already there. But one is missing where has_info is set to TRUE. > The second error: > > gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 > -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_MSWIN > -DFEAT_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer > -freg-struct-return quickfix.c -o gobjnative/quickfix.o > quickfix.c: In function 'qf_jump_newwin': > quickfix.c:3430:22: error: 'old_KeyTyped' undeclared (first use in this > function); did you mean 'KeyTyped'? > 3430 | &opened_window, old_KeyTyped, print_message); > | ^~~~~~~~~~~~ > | KeyTyped > > The attached patch "8.1.1966.quickfix.c.patch" tries to fix this. This > was caused by having FEAT_FOLDING disabled. That looks correct. > Now if I enable both FEAT_QUICKFIX and FEAT_TEXT_PROP, I get some > warnings and a linker error. > > The warnings: > > gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 > -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -pipe -march=native -Wall > -O3 -fomit-frame-pointer -freg-struct-return memline.c -o > objnative/memline.o > In file included from memline.c:45: > memline.c: In function 'ml_append_int': > vim.h:1694:37: warning: 'line' may be used uninitialized in this > function [-Wmaybe-uninitialized] > 1694 | # define mch_memmove(to, from, len) memmove((char*)(to), > (char*)(from), (size_t)(len)) > | ^~~~~~~ > memline.c:2774:13: note: 'line' was declared here > 2774 | char_u *line = line_arg; > | ^~~~ > memline.c:3281:5: warning: 'tofree' may be used uninitialized in this > function [-Wmaybe-uninitialized] > 3281 | vim_free(tofree); > | ^~~~~~~~~~~~~~~~ > memline.c:2719:10: warning: 'new_len' may be used uninitialized in this > function [-Wmaybe-uninitialized] > 2719 | int new_len; > | ^~~~~~~ > > The warning from line 2719 seems straightforward but the others are just > weird. I wonder if gcc has lost the plot here. > > I also get this linker error when building vim.exe (the console version): > > gcc -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 > -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -pipe -march=native -Wall > -O3 -fomit-frame-pointer -freg-struct-return -Wl,-nxcompat,-dynamicbase > -municode -s -o vim.exe objnative/arabic.o objnative/arglist.o > objnative/autocmd.o objnative/beval.o objnative/blob.o > objnative/blowfish.o objnative/buffer.o objnative/change.o > objnative/charset.o objnative/cmdexpand.o objnative/cmdhist.o > objnative/crypt.o objnative/crypt_zip.o objnative/debugger.o > objnative/dict.o objnative/diff.o objnative/digraph.o objnative/edit.o > objnative/eval.o objnative/evalfunc.o objnative/evalvars.o > objnative/ex_cmds.o objnative/ex_cmds2.o objnative/ex_docmd.o > objnative/ex_eval.o objnative/ex_getln.o objnative/fileio.o > objnative/findfile.o objnative/fold.o objnative/getchar.o > objnative/hardcopy.o objnative/hashtab.o objnative/highlight.o > objnative/indent.o objnative/insexpand.o objnative/json.o > objnative/list.o objnative/main.o objnative/map.o objnative/mark.o > objnative/memfile.o objnative/memline.o objnative/menu.o > objnative/message.o objnative/misc1.o objnative/misc2.o objnative/move.o > objnative/mbyte.o objnative/normal.o objnative/ops.o objnative/option.o > objnative/os_mswin.o objnative/os_win32.o objnative/pathdef.o > objnative/popupmnu.o objnative/popupwin.o objnative/profiler.o > objnative/quickfix.o objnative/regexp.o objnative/scriptfile.o > objnative/screen.o objnative/search.o objnative/session.o > objnative/sha256.o objnative/sign.o objnative/spell.o > objnative/spellfile.o objnative/syntax.o objnative/tag.o > objnative/term.o objnative/testing.o objnative/textprop.o objnative/ui.o > objnative/undo.o objnative/usercmd.o objnative/userfunc.o > objnative/version.o objnative/viminfo.o objnative/winclip.o > objnative/window.o objnative/os_w32exe.o objnative/vimrc.o > objnative/xdiffi.o objnative/xemit.o objnative/xprepare.o > objnative/xutils.o objnative/xhistogram.o objnative/xpatience.o > objnative/iscygpty.o -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 > -lcomctl32 -lnetapi32 -lversion -lole32 -luuid > D:/Users/John/Documents/software/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: > > objnative/beval.o:beval.c:(.text+0x126): undefined reference to `vcol2col' > collect2.exe: error: ld returned 1 exit status > make: *** [Make_cyg_ming.mak:1033: vim.exe] Error 1 > make: Target 'all' not remade because of errors. > > The attached patch "8.1.1966.ui.c.patch" tries to fix it. That ifdef is already there, reversed patch? > I hope this all makes sense! I'm not sure if the patches you attached are the right ones. I'll make a best guess, please try again after I submit the fix I made. -- hundred-and-one symptoms of being an internet addict: 175. You send yourself e-mail before you go to bed to remind you what to do when you wake up. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201909032120.x83LKWKr000788%40masaka.moolenaar.net.
