1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0954
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 8.1.0954
Problem: Arguments of semsg() and siemsg() are not checked.
Solution: Add function prototype with __attribute__.
Files: src/message.c, src/proto/message.pro, src/proto.h
*** ../vim-8.1.0953/src/message.c 2019-02-17 17:44:36.215875493 +0100
--- src/message.c 2019-02-19 21:28:21.094091607 +0100
***************
*** 730,735 ****
--- 730,736 ----
return TRUE; /* no error messages at the moment */
}
+ #ifndef PROTO // manual proto with __attribute__
/*
* Print an error message with format string and variable arguments.
* Note: caller must not pass 'IObuff' as 1st argument.
***************
*** 749,754 ****
--- 750,756 ----
}
return TRUE; /* no error messages at the moment */
}
+ #endif
/*
* Same as emsg(...), but abort on error when ABORT_ON_INTERNAL_ERROR is
***************
*** 765,770 ****
--- 767,773 ----
#endif
}
+ #ifndef PROTO // manual proto with __attribute__
/*
* Same as semsg(...) but abort on error when ABORT_ON_INTERNAL_ERROR is
* defined. It is used for internal errors only, so that they can be
***************
*** 783,792 ****
va_end(ap);
emsg_core(IObuff);
}
! #ifdef ABORT_ON_INTERNAL_ERROR
abort();
! #endif
}
/*
* Give an "Internal error" message.
--- 786,796 ----
va_end(ap);
emsg_core(IObuff);
}
! # ifdef ABORT_ON_INTERNAL_ERROR
abort();
! # endif
}
+ #endif
/*
* Give an "Internal error" message.
*** ../vim-8.1.0953/src/proto/message.pro 2019-01-19 17:43:03.425449092 +0100
--- src/proto/message.pro 2019-02-19 21:29:46.765501862 +0100
***************
*** 11,19 ****
void ignore_error_for_testing(char_u *error);
void do_perror(char *msg);
int emsg(char *s);
- int semsg(const char *s, ...);
void iemsg(char *s);
- void siemsg(const char *s, ...);
void internal_error(char *where);
void emsg_invreg(int name);
char *msg_trunc_attr(char *s, int force, int attr);
--- 11,17 ----
*** ../vim-8.1.0953/src/proto.h 2019-02-17 17:44:36.219875473 +0100
--- src/proto.h 2019-02-19 21:32:14.388486699 +0100
***************
*** 134,139 ****
--- 134,161 ----
#endif
;
+ /* These prototypes cannot be produced automatically. */
+ int
+ # ifdef __BORLANDC__
+ _RTLENTRYF
+ # endif
+ semsg(const char *, ...)
+ #ifdef USE_PRINTF_FORMAT_ATTRIBUTE
+ __attribute__((format(printf, 1, 0)))
+ #endif
+ ;
+
+ /* These prototypes cannot be produced automatically. */
+ void
+ # ifdef __BORLANDC__
+ _RTLENTRYF
+ # endif
+ siemsg(const char *, ...)
+ #ifdef USE_PRINTF_FORMAT_ATTRIBUTE
+ __attribute__((format(printf, 1, 0)))
+ #endif
+ ;
+
int
# ifdef __BORLANDC__
_RTLENTRYF
*** ../vim-8.1.0953/src/version.c 2019-02-19 21:24:50.559543423 +0100
--- src/version.c 2019-02-19 21:33:16.472060095 +0100
***************
*** 781,782 ****
--- 781,784 ----
{ /* Add new patch number below this line */
+ /**/
+ 954,
/**/
--
No engineer can take a shower without wondering if some sort of Teflon coating
would make showering unnecessary.
(Scott Adams - The Dilbert principle)
/// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///
|