I've noticed a handful of errors and warnings when compiling Vim with the GCC 
"-ansi -pedantic" flags.

Is there a desire to keep the code so that it compiles cleanly with older 
compilers, or are we assuming that most users have C99 support? 

I can submit patches to fix some warnings/errors when compiling in "ANSI" mode, 
but it's probably not worth the effort if we're assuming C99 is the minimum. 

For example, I noticed this error this morning, building on OpenBSD 5.9 in 
src/eval.c, using the Vim 7.4 patch 1724 code from Github. The "//" comments 
didn't officially become of part of the C standard until C99, although it was a 
common extension before then. 



$ make
Starting make in the src directory.
If there are problems, cd to the src directory and run make there
cd src && make first
gcc -c -I. -Iproto -DHAVE_CONFIG_H   -I/usr/local/include  -Os -Wall -Wextra 
-pipe -ansi -pedantic -DNDEBUG -mtune=native -U_FORTIFY_SOURCE 
-D_FORTIFY_SOURCE=1       -o objects/eval.o eval.c
eval.c: In function 'garbage_collect':
eval.c:7008: error: expected expression before '/' token
eval.c: At top level:
eval.c:9476: warning: comma at end of enumerator list
*** Error 1 in src (Makefile:2729 'objects/eval.o')



Diff to fix:

diff --git a/src/eval.c b/src/eval.c
index 0c270b9..efcaede 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -7005,7 +7005,7 @@ garbage_collect(void)
 #endif

 #ifdef FEAT_JOB_CHANNEL
-//    abort = abort || set_ref_in_channel(copyID);
+/*    abort = abort || set_ref_in_channel(copyID); */
 #endif

     if (!abort)
@@ -9472,7 +9472,7 @@ typedef enum
     ASSERT_NOTEQUAL,
     ASSERT_MATCH,
     ASSERT_NOTMATCH,
-    ASSERT_OTHER,
+    ASSERT_OTHER
 } assert_type_T;

 static void prepare_assert_error(garray_T*gap);

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui