On 13-Dec-2021 01:17, Bram Moolenaar wrote:
Patch 8.2.3787
Problem:    No proper formatting of a C line comment after a statement.
Solution:   Find the start of the line comment, insert the comment leader and
             indent the comment properly.
Files:      src/change.c, src/proto/change.pro, src/search.c,
             src/proto/search.pro, src/cindent.c, src/edit.c, src/normal.c,
             src/textformat.c, src/testdir/test_textformat.vim,
             src/testdir/test_cindent.vim

Hi All,

After this patch, mingw64 (gcc 11.2.0) spits out this compile error if FEAT_SMARTINDENT is not defined:
<snip>
gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return -fpie -fPIE  change.c -o objnative/change.o
change.c: In function 'open_line':
change.c:1644:5: error: 'do_cindent' undeclared (first use in this function); did you mean 'f_cindent'?
 1644 |     do_cindent = !p_paste && (curbuf->b_p_cin
      |     ^~~~~~~~~~
      |     f_cindent
change.c:1644:5: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Make_cyg_ming.mak:1159: objnative/change.o] Error 1
</snip>

The attached patch tries to fix it.

Cheers

--
--
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/449414f0-f1db-7a5c-452d-2f65ae523993%40internode.on.net.
--- change.c.orig       2021-12-13 05:21:09.297546200 +1100
+++ change.c    2021-12-13 05:41:58.654631600 +1100
@@ -1388,6 +1388,9 @@
     char_u     *p;
     int                saved_char = NUL;       // init for GCC
     pos_T      *pos;
+#ifdef FEAT_CINDENT
+    int                do_cindent;
+#endif
 #ifdef FEAT_SMARTINDENT
     int                do_si = (!p_paste && curbuf->b_p_si
 # ifdef FEAT_CINDENT
@@ -1397,9 +1400,6 @@
                                        && *curbuf->b_p_inde == NUL
 # endif
                        );
-#ifdef FEAT_CINDENT
-    int                do_cindent;
-#endif
     int                no_si = FALSE;          // reset did_si afterwards
     int                first_char = NUL;       // init for GCC
 #endif

Raspunde prin e-mail lui