Magellan Linux

Contents of /trunk/vim/patches/vim-7.2-attribute-1.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 916 - (show annotations) (download)
Thu Oct 29 09:21:14 2009 UTC (14 years, 6 months ago) by niro
File size: 3630 byte(s)
fix compile issues

1 Submitted By: Ken Moffat <zarniwhoop73 at googlemail dot com>
2 Date: 2009-09-30
3 Initial Package Version: 7.2
4 Upstream Status: From upstream
5 Origin: Part of ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.173
6 Description: With the cherry-picking of patches in vim's branch_update-21
7 I get:
8
9 buffer.c: In function 'buflist_findpat':
10 buffer.c:2034: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'UNUSED'
11 buffer.c: In function 'build_stl_str_hl':
12 buffer.c:3307: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'UNUSED'
13 make[1]: *** [objects/buffer.o] Error 1
14
15 This patch pulls in the configury for this, whilst avoiding the other changes which
16 we have happily ignored until now (and which depend in part on other changes).
17
18 diff -Naur vim72.orig/src/auto/configure vim72/src/auto/configure
19 --- vim72.orig/src/auto/configure 2008-07-24 13:40:36.000000000 +0100
20 +++ vim72/src/auto/configure 2009-09-30 19:59:21.000000000 +0100
21 @@ -10362,6 +10362,56 @@
22
23 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24
25 +{ $as_echo "$as_me:$LINENO: checking whether __attribute__((unused)) is allowed" >&5
26 +$as_echo_n "checking whether __attribute__((unused)) is allowed... " >&6; }
27 +cat >conftest.$ac_ext <<_ACEOF
28 +/* confdefs.h. */
29 +_ACEOF
30 +cat confdefs.h >>conftest.$ac_ext
31 +cat >>conftest.$ac_ext <<_ACEOF
32 +/* end confdefs.h. */
33 +#include <stdio.h>
34 +int
35 +main ()
36 +{
37 +int x __attribute__((unused));
38 + ;
39 + return 0;
40 +}
41 +_ACEOF
42 +rm -f conftest.$ac_objext
43 +if { (ac_try="$ac_compile"
44 +case "(($ac_try" in
45 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
46 + *) ac_try_echo=$ac_try;;
47 +esac
48 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
49 +$as_echo "$ac_try_echo") >&5
50 + (eval "$ac_compile") 2>conftest.er1
51 + ac_status=$?
52 + grep -v '^ *+' conftest.er1 >conftest.err
53 + rm -f conftest.er1
54 + cat conftest.err >&5
55 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
56 + (exit $ac_status); } && {
57 + test -z "$ac_c_werror_flag" ||
58 + test ! -s conftest.err
59 + } && test -s conftest.$ac_objext; then
60 + { $as_echo "$as_me:$LINENO: result: yes" >&5
61 +$as_echo "yes" >&6; }; cat >>confdefs.h <<\_ACEOF
62 +#define HAVE_ATTRIBUTE_UNUSED 1
63 +_ACEOF
64 +
65 +else
66 + $as_echo "$as_me: failed program was:" >&5
67 +sed 's/^/| /' conftest.$ac_ext >&5
68 +
69 + { $as_echo "$as_me:$LINENO: result: no" >&5
70 +$as_echo "no" >&6; }
71 +fi
72 +
73 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
74 +
75 if test "${ac_cv_header_elf_h+set}" = set; then
76 { $as_echo "$as_me:$LINENO: checking for elf.h" >&5
77 $as_echo_n "checking for elf.h... " >&6; }
78 diff -Naur vim72.orig/src/config.h.in vim72/src/config.h.in
79 --- vim72.orig/src/config.h.in 2008-06-21 16:01:41.000000000 +0100
80 +++ vim72/src/config.h.in 2009-09-30 19:59:21.000000000 +0100
81 @@ -30,6 +30,9 @@
82 /* Define when __DATE__ " " __TIME__ can be used */
83 #undef HAVE_DATE_TIME
84
85 +/* Define when __attribute__((unused)) can be used */
86 +#undef HAVE_ATTRIBUTE_UNUSED
87 +
88 /* defined always when using configure */
89 #undef UNIX
90
91 diff -Naur vim72.orig/src/vim.h vim72/src/vim.h
92 --- vim72.orig/src/vim.h 2008-08-09 17:03:38.000000000 +0100
93 +++ vim72/src/vim.h 2009-09-30 19:59:21.000000000 +0100
94 @@ -262,6 +262,14 @@
95 # define __PARMS(x) __ARGS(x)
96 #endif
97
98 +/* Mark unused function arguments with UNUSED, so that gcc -Wunused-parameter
99 + * can be used to check for mistakes. */
100 +#ifdef HAVE_ATTRIBUTE_UNUSED
101 +# define UNUSED __attribute__((unused))
102 +#else
103 +# define UNUSED
104 +#endif
105 +
106 /* if we're compiling in C++ (currently only KVim), the system
107 * headers must have the correct prototypes or nothing will build.
108 * conversely, our prototypes might clash due to throw() specifiers and