summaryrefslogtreecommitdiff
path: root/public/bash-1.14.7-gcc4-stdarg.patch
blob: 28d7c077e321e7e8d05fc03dc54b93ec500baddc (plain)
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
diff -ru bash-1.14.7/builtins/common.c bash-1.14.7.new2/builtins/common.c
--- bash-1.14.7/builtins/common.c	1995-01-30 13:02:37.000000000 -0500
+++ bash-1.14.7.new2/builtins/common.c	2015-03-17 02:38:18.479744668 -0400
@@ -20,7 +20,7 @@
 #include <sys/types.h>
 #include "../posixstat.h"
 #if defined (HAVE_VFPRINTF)
-#include <varargs.h>
+#include <stdarg.h>
 #endif /* VFPRINTF */
 
 #if defined (HAVE_STRING_H)
@@ -114,17 +114,14 @@
    shell. */
 #if defined (HAVE_VFPRINTF)
 void
-builtin_error (va_alist)
-     va_dcl
+builtin_error (char *format, ...)
 {
-  char *format;
   va_list args;
 
   if (this_command_name && *this_command_name)
     fprintf (stderr, "%s: ", this_command_name);
 
-  va_start (args);
-  format = va_arg (args, char *);
+  va_start (args, format);
   vfprintf (stderr, format, args);
   va_end (args);
   fprintf (stderr, "\n");
diff -ru bash-1.14.7/builtins/common.h bash-1.14.7.new2/builtins/common.h
--- bash-1.14.7/builtins/common.h	1994-04-18 19:39:46.000000000 -0500
+++ bash-1.14.7.new2/builtins/common.h	2015-03-17 02:38:18.479744668 -0400
@@ -23,7 +23,7 @@
 
 #define ISOPTION(s, c)	(s[0] == '-' && !s[2] && s[1] == c)
 
-extern void builtin_error ();
+extern void builtin_error (char *, ...);
 extern void bad_option ();
 
 extern int get_numeric_arg ();
diff -ru bash-1.14.7/error.c bash-1.14.7.new2/error.c
--- bash-1.14.7/error.c	1994-12-05 13:39:31.000000000 -0500
+++ bash-1.14.7.new2/error.c	2015-03-17 02:38:18.479744668 -0400
@@ -22,7 +22,7 @@
 #include <fcntl.h>
 
 #if defined (HAVE_VFPRINTF)
-#include <varargs.h>
+#include <stdarg.h>
 #endif
 
 #include <errno.h>
@@ -121,18 +121,15 @@
 #else /* We have VARARGS support, so use it. */
 
 void
-programming_error (va_alist)
-     va_dcl
+programming_error (char *format, ...)
 {
   va_list args;
-  char *format;
 
 #if defined (JOB_CONTROL)
   give_terminal_to (shell_pgrp);
 #endif /* JOB_CONTROL */
 
-  va_start (args);
-  format = va_arg (args, char *);
+  va_start (args, format);
   vfprintf (stderr, format, args);
   fprintf (stderr, "\n");
   va_end (args);
@@ -144,15 +141,12 @@
 }
 
 void
-report_error (va_alist)
-     va_dcl
+report_error (char *format, ...)
 {
   va_list args;
-  char *format;
 
   fprintf (stderr, "%s: ", get_name_for_error ());
-  va_start (args);
-  format = va_arg (args, char *);
+  va_start (args, format);
   vfprintf (stderr, format, args);
   fprintf (stderr, "\n");
 
@@ -162,15 +156,12 @@
 }
 
 void
-fatal_error (va_alist)
-     va_dcl
+fatal_error (char *format, ...)
 {
   va_list args;
-  char *format;
 
   fprintf (stderr, "%s: ", get_name_for_error ());
-  va_start (args);
-  format = va_arg (args, char *);
+  va_start (args, format);
   vfprintf (stderr, format, args);
   fprintf (stderr, "\n");
 
@@ -179,30 +170,24 @@
 }
 
 void
-internal_error (va_alist)
-     va_dcl
+internal_error (char *format, ...)
 {
   va_list args;
-  char *format;
 
   fprintf (stderr, "%s: ", get_name_for_error ());
-  va_start (args);
-  format = va_arg (args, char *);
+  va_start (args, format);
   vfprintf (stderr, format, args);
   fprintf (stderr, "\n");
 
   va_end (args);
 }
 
-itrace (va_alist)
-     va_dcl
+itrace (char *format, ...)
 {
   va_list args;
-  char *format;
 
   fprintf(stderr, "TRACE: pid %d: ", getpid());
-  va_start (args);
-  format = va_arg (args, char *);
+  va_start (args, format);
   vfprintf (stderr, format, args);
   fprintf (stderr, "\n");
 
@@ -214,11 +199,9 @@
 #if 0
 /* A trace function for silent debugging -- doesn't require a control
    terminal. */
-trace (va_alist)
-     va_dcl
+trace (char *format, ...)
 {
   va_list args;
-  char *format;
   static FILE *tracefp = (FILE *)NULL;
 
   if (tracefp == NULL)
@@ -231,8 +214,7 @@
 
   fprintf(tracefp, "TRACE: pid %d: ", getpid());
 
-  va_start (args);
-  format = va_arg (args, char *);
+  va_start (args, format);
   vfprintf (tracefp, format, args);
   fprintf (tracefp, "\n");
 
diff -ru bash-1.14.7/error.h bash-1.14.7.new2/error.h
--- bash-1.14.7/error.h	1994-01-26 14:31:10.000000000 -0500
+++ bash-1.14.7.new2/error.h	2015-03-17 02:38:18.479744668 -0400
@@ -25,10 +25,10 @@
 extern void file_error ();
 
 /* Report a programmer's error, and abort.  Pass REASON, and ARG1 ... ARG5. */
-extern void programming_error ();
+extern void programming_error (char *, ...);
 
 /* General error reporting.  Pass FORMAT and ARG1 ... ARG5. */
-extern void report_error ();
+extern void report_error (char *, ...);
 
 /* Report an unrecoverable error and exit.  Pass FORMAT and ARG1 ... ARG5. */
-extern void fatal_error ();
+extern void fatal_error (char *, ...);
diff -ru bash-1.14.7/lib/readline/display.c bash-1.14.7.new2/lib/readline/display.c
--- bash-1.14.7/lib/readline/display.c	1995-05-01 09:18:02.000000000 -0500
+++ bash-1.14.7.new2/lib/readline/display.c	2015-03-17 02:46:02.243878132 -0400
@@ -1020,14 +1020,11 @@
    mini-modeline. */
 
 #if defined (HAVE_VARARGS_H)
-rl_message (va_alist)
-     va_dcl
+rl_message (char *format, ...)
 {
-  char *format;
   va_list args;
 
-  va_start (args);
-  format = va_arg (args, char *);
+  va_start (args, format);
   vsprintf (msg_buf, format, args);
   va_end (args);
 
diff -ru bash-1.14.7/lib/readline/readline.h bash-1.14.7.new2/lib/readline/readline.h
--- bash-1.14.7/lib/readline/readline.h	1994-07-26 14:35:40.000000000 -0500
+++ bash-1.14.7.new2/lib/readline/readline.h	2015-03-17 02:46:34.466572077 -0400
@@ -271,7 +271,7 @@
 
 /* Functions in display.c */
 extern void rl_redisplay ();
-extern int rl_message (), rl_clear_message ();
+extern int rl_message (char *, ...), rl_clear_message ();
 extern int rl_reset_line_state ();
 extern int rl_character_len ();
 extern int rl_show_char ();
diff -ru bash-1.14.7/lib/readline/rldefs.h bash-1.14.7.new2/lib/readline/rldefs.h
--- bash-1.14.7/lib/readline/rldefs.h	1995-02-25 18:55:43.000000000 -0500
+++ bash-1.14.7.new2/lib/readline/rldefs.h	2015-03-17 02:45:26.611251831 -0400
@@ -150,7 +150,7 @@
 #endif /* !strchr && !__STDC__ */
 
 #if defined (HAVE_VARARGS_H)
-#  include <varargs.h>
+#  include <stdarg.h>
 #endif /* HAVE_VARARGS_H */
 
 /* This is needed to include support for TIOCGWINSZ and window resizing. */
--- bash-1.14.7/print_cmd.c	1995-01-30 12:45:09.000000000 -0500
+++ bash-1.14.7.new2/print_cmd.c	2015-03-17 02:44:02.712916475 -0400
@@ -20,7 +20,7 @@
 #include <stdio.h>
 
 #if defined (HAVE_VARARGS_H)
-#  include <varargs.h>
+#  include <stdarg.h>
 #endif
 
 #if defined (HAVE_STRING_H)
@@ -41,7 +41,7 @@
 static int indentation = 0;
 static int indentation_amount = 4;
 
-static void cprintf (), newline (), indent (), the_printed_command_resize ();
+static void cprintf (char *, ...), newline (), indent (), the_printed_command_resize ();
 static void semicolon ();
 
 static void make_command_string_internal ();
@@ -730,16 +730,14 @@
 
 /* How to make the string. */
 static void
-cprintf (va_alist)
-     va_dcl
+cprintf (char *control, ...)
 {
   register char *s;
-  char *control, char_arg[2], *argp;
+  char char_arg[2], *argp;
   int digit_arg, arg_len, c;
   va_list args;
 
-  va_start (args);
-  control = va_arg (args, char *);
+  va_start (args, control);
 
   arg_len = strlen (control);
   the_printed_command_resize (arg_len + 1);
diff -ru bash-1.14.7/shell.c bash-1.14.7.new2/shell.c
--- bash-1.14.7/shell.c	1995-04-06 15:45:00.000000000 -0500
+++ bash-1.14.7.new2/shell.c	2015-03-17 02:38:18.483077935 -0400
@@ -43,7 +43,7 @@
 #include "bashansi.h"
 
 #if defined (HAVE_VARARGS_H)
-#include <varargs.h>
+#include <stdarg.h>
 #endif
 
 #include "shell.h"