Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merged from the latest developing branch.

git-svn-id: https://vim.svn.sourceforge.net/svnroot/vim/trunk@1460 2a77ed30-b011-0410-a7ad-c7884a0aa172
  • Loading branch information...
commit 046c7872a4ca631ae5ea5b7267a741bd3a345f99 1 parent 138d22b
authored May 15, 2009
50  src/auto/configure
@@ -10362,6 +10362,56 @@ fi
10362 10362
 
10363 10363
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10364 10364
 
  10365
+{ $as_echo "$as_me:$LINENO: checking whether __attribute__((unused)) is allowed" >&5
  10366
+$as_echo_n "checking whether __attribute__((unused)) is allowed... " >&6; }
  10367
+cat >conftest.$ac_ext <<_ACEOF
  10368
+/* confdefs.h.  */
  10369
+_ACEOF
  10370
+cat confdefs.h >>conftest.$ac_ext
  10371
+cat >>conftest.$ac_ext <<_ACEOF
  10372
+/* end confdefs.h.  */
  10373
+#include <stdio.h>
  10374
+int
  10375
+main ()
  10376
+{
  10377
+int x __attribute__((unused));
  10378
+  ;
  10379
+  return 0;
  10380
+}
  10381
+_ACEOF
  10382
+rm -f conftest.$ac_objext
  10383
+if { (ac_try="$ac_compile"
  10384
+case "(($ac_try" in
  10385
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  10386
+  *) ac_try_echo=$ac_try;;
  10387
+esac
  10388
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
  10389
+$as_echo "$ac_try_echo") >&5
  10390
+  (eval "$ac_compile") 2>conftest.er1
  10391
+  ac_status=$?
  10392
+  grep -v '^ *+' conftest.er1 >conftest.err
  10393
+  rm -f conftest.er1
  10394
+  cat conftest.err >&5
  10395
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
  10396
+  (exit $ac_status); } && {
  10397
+	 test -z "$ac_c_werror_flag" ||
  10398
+	 test ! -s conftest.err
  10399
+       } && test -s conftest.$ac_objext; then
  10400
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
  10401
+$as_echo "yes" >&6; }; cat >>confdefs.h <<\_ACEOF
  10402
+#define HAVE_ATTRIBUTE_UNUSED 1
  10403
+_ACEOF
  10404
+
  10405
+else
  10406
+  $as_echo "$as_me: failed program was:" >&5
  10407
+sed 's/^/| /' conftest.$ac_ext >&5
  10408
+
  10409
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
  10410
+$as_echo "no" >&6; }
  10411
+fi
  10412
+
  10413
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  10414
+
10365 10415
 if test "${ac_cv_header_elf_h+set}" = set; then
10366 10416
   { $as_echo "$as_me:$LINENO: checking for elf.h" >&5
10367 10417
 $as_echo_n "checking for elf.h... " >&6; }
14  src/buffer.c
@@ -512,12 +512,11 @@ buf_clear_file(buf)
512 512
  * buf_freeall() - free all things allocated for a buffer that are related to
513 513
  * the file.
514 514
  */
515  
-/*ARGSUSED*/
516 515
     void
517 516
 buf_freeall(buf, del_buf, wipe_buf)
518 517
     buf_T	*buf;
519  
-    int		del_buf;	/* buffer is going to be deleted */
520  
-    int		wipe_buf;	/* buffer is going to be wiped out */
  518
+    int		del_buf UNUSED;	    /* buffer is going to be deleted */
  519
+    int		wipe_buf UNUSED;    /* buffer is going to be wiped out */
521 520
 {
522 521
 #ifdef FEAT_AUTOCMD
523 522
     int		is_curbuf = (buf == curbuf);
@@ -2437,11 +2436,10 @@ wininfo_other_tab_diff(wip)
2437 2436
  * another tab page.
2438 2437
  * Returns NULL when there isn't any info.
2439 2438
  */
2440  
-/*ARGSUSED*/
2441 2439
     static wininfo_T *
2442 2440
 find_wininfo(buf, skip_diff_buffer)
2443 2441
     buf_T	*buf;
2444  
-    int		skip_diff_buffer;
  2442
+    int		skip_diff_buffer UNUSED;
2445 2443
 {
2446 2444
     wininfo_T	*wip;
2447 2445
 
@@ -4278,10 +4276,9 @@ fix_fname(fname)
4278 4276
  * Make "ffname" a full file name, set "sfname" to "ffname" if not NULL.
4279 4277
  * "ffname" becomes a pointer to allocated memory (or NULL).
4280 4278
  */
4281  
-/*ARGSUSED*/
4282 4279
     void
4283 4280
 fname_expand(buf, ffname, sfname)
4284  
-    buf_T	*buf;
  4281
+    buf_T	*buf UNUSED;
4285 4282
     char_u	**ffname;
4286 4283
     char_u	**sfname;
4287 4284
 {
@@ -5577,11 +5574,10 @@ buf_contents_changed(buf)
5577 5574
  * this buffer.  Call this to wipe out a temp buffer that does not contain any
5578 5575
  * marks.
5579 5576
  */
5580  
-/*ARGSUSED*/
5581 5577
     void
5582 5578
 wipe_buffer(buf, aucmd)
5583 5579
     buf_T	*buf;
5584  
-    int		aucmd;	    /* When TRUE trigger autocommands. */
  5580
+    int		aucmd UNUSED;	    /* When TRUE trigger autocommands. */
5585 5581
 {
5586 5582
     if (buf->b_fnum == top_file_num - 1)
5587 5583
 	--top_file_num;
3  src/charset.c
@@ -1026,13 +1026,12 @@ lbr_chartabsize_adv(s, col)
1026 1026
  * string at start of line.  Warning: *headp is only set if it's a non-zero
1027 1027
  * value, init to 0 before calling.
1028 1028
  */
1029  
-/*ARGSUSED*/
1030 1029
     int
1031 1030
 win_lbr_chartabsize(wp, s, col, headp)
1032 1031
     win_T	*wp;
1033 1032
     char_u	*s;
1034 1033
     colnr_T	col;
1035  
-    int		*headp;
  1034
+    int		*headp UNUSED;
1036 1035
 {
1037 1036
 #ifdef FEAT_LINEBREAK
1038 1037
     int		c;
3  src/config.h.in
@@ -30,6 +30,9 @@
30 30
 /* Define when __DATE__ " " __TIME__ can be used */
31 31
 #undef HAVE_DATE_TIME
32 32
 
  33
+/* Define when __attribute__((unused)) can be used */
  34
+#undef HAVE_ATTRIBUTE_UNUSED
  35
+
33 36
 /* defined always when using configure */
34 37
 #undef UNIX
35 38
 
5  src/configure.in
@@ -2067,6 +2067,11 @@ AC_TRY_COMPILE([#include <stdio.h>], [printf("(" __DATE__ " " __TIME__ ")");],
2067 2067
 	AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME),
2068 2068
 	AC_MSG_RESULT(no))
2069 2069
 
  2070
+AC_MSG_CHECKING(whether __attribute__((unused)) is allowed)
  2071
+AC_TRY_COMPILE([#include <stdio.h>], [int x __attribute__((unused));],
  2072
+	AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ATTRIBUTE_UNUSED),
  2073
+	AC_MSG_RESULT(no))
  2074
+
2070 2075
 dnl Checks for header files.
2071 2076
 AC_CHECK_HEADER(elf.h, HAS_ELF=1)
2072 2077
 dnl AC_CHECK_HEADER(dwarf.h, SVR4=1)
6  src/diff.c
@@ -652,10 +652,9 @@ diff_write(buf, fname)
652 652
  * The buffers are written to a file, also for unmodified buffers (the file
653 653
  * could have been produced by autocommands, e.g. the netrw plugin).
654 654
  */
655  
-/*ARGSUSED*/
656 655
     void
657 656
 ex_diffupdate(eap)
658  
-    exarg_T	*eap;	    /* can be NULL, it's not used */
  657
+    exarg_T	*eap UNUSED;	    /* can be NULL */
659 658
 {
660 659
     buf_T	*buf;
661 660
     int		idx_orig;
@@ -1094,10 +1093,9 @@ ex_diffsplit(eap)
1094 1093
 /*
1095 1094
  * Set options to show difs for the current window.
1096 1095
  */
1097  
-/*ARGSUSED*/
1098 1096
     void
1099 1097
 ex_diffthis(eap)
1100  
-    exarg_T	*eap;
  1098
+    exarg_T	*eap UNUSED;
1101 1099
 {
1102 1100
     /* Set 'diff', 'scrollbind' on and 'wrap' off. */
1103 1101
     diff_win_options(curwin, TRUE);
6  src/edit.c
@@ -1447,10 +1447,9 @@ edit(cmdchar, startln, count)
1447 1447
  * Only redraw when there are no characters available.  This speeds up
1448 1448
  * inserting sequences of characters (e.g., for CTRL-R).
1449 1449
  */
1450  
-/*ARGSUSED*/
1451 1450
     static void
1452 1451
 ins_redraw(ready)
1453  
-    int		ready;	    /* not busy with something */
  1452
+    int		ready UNUSED;	    /* not busy with something */
1454 1453
 {
1455 1454
     if (!char_avail())
1456 1455
     {
@@ -1962,10 +1961,9 @@ backspace_until_column(col)
1962 1961
  * Only matters when there are composing characters.
1963 1962
  * Return TRUE when something was deleted.
1964 1963
  */
1965  
-/*ARGSUSED*/
1966 1964
    static int
1967 1965
 del_char_after_col(limit_col)
1968  
-    int limit_col;
  1966
+    int limit_col UNUSED;
1969 1967
 {
1970 1968
 #ifdef FEAT_MBYTE
1971 1969
     if (enc_utf8 && limit_col >= 0)
22  src/ex_cmds.c
@@ -43,10 +43,9 @@ static int
43 43
 /*
44 44
  * ":ascii" and "ga".
45 45
  */
46  
-/*ARGSUSED*/
47 46
     void
48 47
 do_ascii(eap)
49  
-    exarg_T	*eap;
  48
+    exarg_T	*eap UNUSED;
50 49
 {
51 50
     int		c;
52 51
     int		cval;
@@ -2373,10 +2372,9 @@ viminfo_writestring(fd, p)
2373 2372
  *   ^?		^H
2374 2373
  * not ^?	^?
2375 2374
  */
2376  
-/*ARGSUSED*/
2377 2375
     void
2378 2376
 do_fixdel(eap)
2379  
-    exarg_T	*eap;
  2377
+    exarg_T	*eap UNUSED;
2380 2378
 {
2381 2379
     char_u  *p;
2382 2380
 
@@ -4637,7 +4635,7 @@ do_sub(eap)
4637 4635
 
4638 4636
 		if (do_ask)
4639 4637
 		{
4640  
-		    int typed;
  4638
+		    int typed = 0;
4641 4639
 
4642 4640
 		    /* change State to CONFIRM, so that the mouse works
4643 4641
 		     * properly */
@@ -6127,10 +6125,9 @@ fix_help_buffer()
6127 6125
 /*
6128 6126
  * ":exusage"
6129 6127
  */
6130  
-/*ARGSUSED*/
6131 6128
     void
6132 6129
 ex_exusage(eap)
6133  
-    exarg_T	*eap;
  6130
+    exarg_T	*eap UNUSED;
6134 6131
 {
6135 6132
     do_cmdline_cmd((char_u *)"help ex-cmd-index");
6136 6133
 }
@@ -6138,10 +6135,9 @@ ex_exusage(eap)
6138 6135
 /*
6139 6136
  * ":viusage"
6140 6137
  */
6141  
-/*ARGSUSED*/
6142 6138
     void
6143 6139
 ex_viusage(eap)
6144  
-    exarg_T	*eap;
  6140
+    exarg_T	*eap UNUSED;
6145 6141
 {
6146 6142
     do_cmdline_cmd((char_u *)"help normal-index");
6147 6143
 }
@@ -6553,6 +6549,7 @@ struct sign
6553 6549
 static sign_T	*first_sign = NULL;
6554 6550
 static int	last_sign_typenr = MAX_TYPENR;	/* is decremented */
6555 6551
 
  6552
+static int sign_cmd_idx __ARGS((char_u *begin_cmd, char_u *end_cmd));
6556 6553
 static void sign_list_defined __ARGS((sign_T *sp));
6557 6554
 static void sign_undefine __ARGS((sign_T *sp, sign_T *sp_prev));
6558 6555
 
@@ -6579,8 +6576,8 @@ static char *cmds[] = {
6579 6576
  */
6580 6577
     static int
6581 6578
 sign_cmd_idx(begin_cmd, end_cmd)
6582  
-    char	*begin_cmd;	/* begin of sign subcmd */
6583  
-    char	*end_cmd;	/* just after sign subcmd */
  6579
+    char_u	*begin_cmd;	/* begin of sign subcmd */
  6580
+    char_u	*end_cmd;	/* just after sign subcmd */
6584 6581
 {
6585 6582
     int		idx;
6586 6583
     char	save = *end_cmd;
@@ -7153,10 +7150,9 @@ static enum
7153 7150
  * Function given to ExpandGeneric() to obtain the sign command
7154 7151
  * expansion.
7155 7152
  */
7156  
-/*ARGSUSED*/
7157 7153
     char_u *
7158 7154
 get_sign_name(xp, idx)
7159  
-    expand_T	*xp;
  7155
+    expand_T	*xp UNUSED;
7160 7156
     int		idx;
7161 7157
 {
7162 7158
     sign_T	*sp;
31  src/ex_cmds2.c
@@ -680,10 +680,9 @@ ex_breakdel(eap)
680 680
 /*
681 681
  * ":breaklist".
682 682
  */
683  
-/*ARGSUSED*/
684 683
     void
685 684
 ex_breaklist(eap)
686  
-    exarg_T	*eap;
  685
+    exarg_T	*eap UNUSED;
687 686
 {
688 687
     struct debuggy *bp;
689 688
     int		i;
@@ -1342,14 +1341,13 @@ autowrite_all()
1342 1341
 /*
1343 1342
  * return TRUE if buffer was changed and cannot be abandoned.
1344 1343
  */
1345  
-/*ARGSUSED*/
1346 1344
     int
1347 1345
 check_changed(buf, checkaw, mult_win, forceit, allbuf)
1348 1346
     buf_T	*buf;
1349 1347
     int		checkaw;	/* do autowrite if buffer was changed */
1350 1348
     int		mult_win;	/* check also when several wins for the buf */
1351 1349
     int		forceit;
1352  
-    int		allbuf;		/* may write all buffers */
  1350
+    int		allbuf UNUSED;	/* may write all buffers */
1353 1351
 {
1354 1352
     if (       !forceit
1355 1353
 	    && bufIsChanged(buf)
@@ -1759,12 +1757,11 @@ set_arglist(str)
1759 1757
  *
1760 1758
  * Return FAIL for failure, OK otherwise.
1761 1759
  */
1762  
-/*ARGSUSED*/
1763 1760
     static int
1764 1761
 do_arglist(str, what, after)
1765 1762
     char_u	*str;
1766  
-    int		what;
1767  
-    int		after;		/* 0 means before first one */
  1763
+    int		what UNUSED;
  1764
+    int		after UNUSED;		/* 0 means before first one */
1768 1765
 {
1769 1766
     garray_T	new_ga;
1770 1767
     int		exp_count;
@@ -2549,11 +2546,10 @@ ex_runtime(eap)
2549 2546
 
2550 2547
 static void source_callback __ARGS((char_u *fname, void *cookie));
2551 2548
 
2552  
-/*ARGSUSED*/
2553 2549
     static void
2554 2550
 source_callback(fname, cookie)
2555 2551
     char_u	*fname;
2556  
-    void	*cookie;
  2552
+    void	*cookie UNUSED;
2557 2553
 {
2558 2554
     (void)do_source(fname, FALSE, DOSO_NONE);
2559 2555
 }
@@ -2680,10 +2676,9 @@ do_in_runtimepath(name, all, callback, cookie)
2680 2676
 /*
2681 2677
  * ":options"
2682 2678
  */
2683  
-/*ARGSUSED*/
2684 2679
     void
2685 2680
 ex_options(eap)
2686  
-    exarg_T	*eap;
  2681
+    exarg_T	*eap UNUSED;
2687 2682
 {
2688 2683
     cmd_source((char_u *)SYS_OPTWIN_FILE, NULL);
2689 2684
 }
@@ -3190,10 +3185,9 @@ do_source(fname, check_other, is_vimrc)
3190 3185
 /*
3191 3186
  * ":scriptnames"
3192 3187
  */
3193  
-/*ARGSUSED*/
3194 3188
     void
3195 3189
 ex_scriptnames(eap)
3196  
-    exarg_T	*eap;
  3190
+    exarg_T	*eap UNUSED;
3197 3191
 {
3198 3192
     int i;
3199 3193
 
@@ -3317,12 +3311,11 @@ fgets_cr(s, n, stream)
3317 3311
  * Return a pointer to the line in allocated memory.
3318 3312
  * Return NULL for end-of-file or some error.
3319 3313
  */
3320  
-/* ARGSUSED */
3321 3314
     char_u *
3322 3315
 getsourceline(c, cookie, indent)
3323  
-    int		c;		/* not used */
  3316
+    int		c UNUSED;
3324 3317
     void	*cookie;
3325  
-    int		indent;		/* not used */
  3318
+    int		indent UNUSED;
3326 3319
 {
3327 3320
     struct source_cookie *sp = (struct source_cookie *)cookie;
3328 3321
     char_u		*line;
@@ -3649,10 +3642,9 @@ script_line_end()
3649 3642
  * ":scriptencoding": Set encoding conversion for a sourced script.
3650 3643
  * Without the multi-byte feature it's simply ignored.
3651 3644
  */
3652  
-/*ARGSUSED*/
3653 3645
     void
3654 3646
 ex_scriptencoding(eap)
3655  
-    exarg_T	*eap;
  3647
+    exarg_T	*eap UNUSED;
3656 3648
 {
3657 3649
 #ifdef FEAT_MBYTE
3658 3650
     struct source_cookie	*sp;
@@ -4101,10 +4093,9 @@ ex_language(eap)
4101 4093
  * Function given to ExpandGeneric() to obtain the possible arguments of the
4102 4094
  * ":language" command.
4103 4095
  */
4104  
-/*ARGSUSED*/
4105 4096
     char_u *
4106 4097
 get_lang_arg(xp, idx)
4107  
-    expand_T	*xp;
  4098
+    expand_T	*xp UNUSED;
4108 4099
     int		idx;
4109 4100
 {
4110 4101
     if (idx == 0)
4  src/os_mswin.c
@@ -1227,8 +1227,8 @@ utf16_to_enc(short_u *str, int *lenp)
1227 1227
  * Wait for another process to Close the Clipboard.
1228 1228
  * Returns TRUE for success.
1229 1229
  */
1230  
-    int
1231  
-vim_open_clipboard()
  1230
+    static int
  1231
+vim_open_clipboard(void)
1232 1232
 {
1233 1233
     int delay = 10;
1234 1234
 
9  src/version.c
@@ -677,6 +677,12 @@ static char *(features[]) =
677 677
 static int included_patches[] =
678 678
 {   /* Add new patch number below this line */
679 679
 /**/
  680
+    173,
  681
+/**/
  682
+    172,
  683
+/**/
  684
+    171,
  685
+/**/
680 686
     170,
681 687
 /**/
682 688
     169,
@@ -1619,10 +1625,9 @@ do_intro_line(row, mesg, add_version, attr)
1619 1625
 /*
1620 1626
  * ":intro": clear screen, display intro screen and wait for return.
1621 1627
  */
1622  
-/*ARGSUSED*/
1623 1628
     void
1624 1629
 ex_intro(eap)
1625  
-    exarg_T	*eap;
  1630
+    exarg_T	*eap UNUSED;
1626 1631
 {
1627 1632
     screenclear();
1628 1633
     intro_message(TRUE);
8  src/vim.h
@@ -262,6 +262,14 @@
262 262
 # define __PARMS(x) __ARGS(x)
263 263
 #endif
264 264
 
  265
+/* Mark unused function arguments with UNUSED, so that gcc -Wunused-parameter
  266
+ * can be used to check for mistakes. */
  267
+#ifdef HAVE_ATTRIBUTE_UNUSED
  268
+# define UNUSED __attribute__((unused))
  269
+#else
  270
+# define UNUSED
  271
+#endif
  272
+
265 273
 /* if we're compiling in C++ (currently only KVim), the system
266 274
  * headers must have the correct prototypes or nothing will build.
267 275
  * conversely, our prototypes might clash due to throw() specifiers and

0 notes on commit 046c787

Please sign in to comment.
Something went wrong with that request. Please try again.