ports/56146: shells/bash1 varargs -> stdarg
Michael Edenfield
kutulu at kutulu.org
Fri Aug 29 17:10:16 UTC 2003
>Number: 56146
>Category: ports
>Synopsis: shells/bash1 varargs -> stdarg
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Aug 29 10:10:13 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Michael Edenfield
>Release: FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD wombat.localnet 5.1-CURRENT FreeBSD 5.1-CURRENT #7: Sun Aug 24 21:35:57 EDT 2003 root at wombat.localnet:/usr/obj/usr/src/sys/ATHLON i386
>Description:
>How-To-Repeat:
>Fix:
diff -urN bash1.orig/files/patch-af bash1/files/patch-af
--- bash1.orig/files/patch-af Wed Dec 31 19:00:00 1969
+++ bash1/files/patch-af Fri Aug 29 11:47:27 2003
@@ -0,0 +1,14 @@
+--- support/mksysdefs.orig Fri Aug 29 11:26:47 2003
++++ support/mksysdefs Fri Aug 29 11:27:59 2003
+@@ -415,7 +415,10 @@
+ echo "#endif /* HAVE_STRING_H */" >>$sysdefs
+ fi
+
+-file=varargs.h
++# varargs.h and it's var args support is deprecated in GCC 3.3,
++# and has been obsolete for a while. Assume VARARGS means
++# STDARG elsewhere in the code.
++file=stdarg.h
+ eval $findf
+ if [ -n "$found" ]; then
+ echo "" >>$sysdefs
diff -urN bash1.orig/files/patch-am bash1/files/patch-am
--- bash1.orig/files/patch-am Wed Dec 31 19:00:00 1969
+++ bash1/files/patch-am Fri Aug 29 12:07:59 2003
@@ -0,0 +1,41 @@
+--- print_cmd.c.orig Fri Aug 29 12:06:43 2003
++++ print_cmd.c Fri Aug 29 12:07:51 2003
+@@ -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,8 @@
+ static int indentation = 0;
+ static int indentation_amount = 4;
+
+-static void cprintf (), newline (), indent (), the_printed_command_resize ();
++static void cprintf (char *, ...);
++static void newline (), indent (), the_printed_command_resize ();
+ static void semicolon ();
+
+ static void make_command_string_internal ();
+@@ -730,16 +731,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 -urN bash1.orig/files/patch-an bash1/files/patch-an
--- bash1.orig/files/patch-an Wed Dec 31 19:00:00 1969
+++ bash1/files/patch-an Fri Aug 29 12:34:57 2003
@@ -0,0 +1,102 @@
+--- error.c.orig Fri Aug 29 12:21:42 2003
++++ error.c Fri Aug 29 12:24:18 2003
+@@ -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,14 +170,12 @@
+ }
+
+ 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);
++ va_start (args, format);
+ format = va_arg (args, char *);
+ vfprintf (stderr, format, args);
+ fprintf (stderr, "\n");
+@@ -194,14 +183,12 @@
+ 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);
++ va_start (args, format);
+ format = va_arg (args, char *);
+ vfprintf (stderr, format, args);
+ fprintf (stderr, "\n");
diff -urN bash1.orig/files/patch-ao bash1/files/patch-ao
--- bash1.orig/files/patch-ao Wed Dec 31 19:00:00 1969
+++ bash1/files/patch-ao Fri Aug 29 12:35:04 2003
@@ -0,0 +1,16 @@
+--- error.h.orig Fri Aug 29 12:24:24 2003
++++ error.h Fri Aug 29 12:25:40 2003
+@@ -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 -urN bash1.orig/files/patch-ap bash1/files/patch-ap
--- bash1.orig/files/patch-ap Wed Dec 31 19:00:00 1969
+++ bash1/files/patch-ap Fri Aug 29 12:35:35 2003
@@ -0,0 +1,30 @@
+--- builtins/common.c.orig Fri Aug 29 12:14:26 2003
++++ builtins/common.c Fri Aug 29 12:18:31 2003
+@@ -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,16 +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);
++ va_start (args, format);
+ format = va_arg (args, char *);
+ vfprintf (stderr, format, args);
+ va_end (args);
diff -urN bash1.orig/files/patch-aq bash1/files/patch-aq
--- bash1.orig/files/patch-aq Wed Dec 31 19:00:00 1969
+++ bash1/files/patch-aq Fri Aug 29 12:35:43 2003
@@ -0,0 +1,11 @@
+--- builtins/common.h.orig Fri Aug 29 12:14:20 2003
++++ builtins/common.h Fri Aug 29 12:14:46 2003
+@@ -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 -urN bash1.orig/files/patch-ar bash1/files/patch-ar
--- bash1.orig/files/patch-ar Wed Dec 31 19:00:00 1969
+++ bash1/files/patch-ar Fri Aug 29 12:36:05 2003
@@ -0,0 +1,18 @@
+--- lib/readline/display.c.orig Fri Aug 29 12:28:33 2003
++++ lib/readline/display.c Fri Aug 29 12:29:29 2003
+@@ -1020,13 +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);
++ va_start (args, format);
+ format = va_arg (args, char *);
+ vsprintf (msg_buf, format, args);
+ va_end (args);
diff -urN bash1.orig/files/patch-as bash1/files/patch-as
--- bash1.orig/files/patch-as Wed Dec 31 19:00:00 1969
+++ bash1/files/patch-as Fri Aug 29 12:36:23 2003
@@ -0,0 +1,11 @@
+--- lib/readline/rldefs.h.orig Fri Aug 29 12:30:13 2003
++++ lib/readline/rldefs.h Fri Aug 29 12:30:32 2003
+@@ -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. */
diff -urN bash1.orig/files/patch-at bash1/files/patch-at
--- bash1.orig/files/patch-at Wed Dec 31 19:00:00 1969
+++ bash1/files/patch-at Fri Aug 29 12:36:36 2003
@@ -0,0 +1,12 @@
+--- lib/readline/readline.h.orig Fri Aug 29 12:33:32 2003
++++ lib/readline/readline.h Fri Aug 29 12:31:34 2003
+@@ -271,7 +271,8 @@
+
+ /* Functions in display.c */
+ extern void rl_redisplay ();
+-extern int rl_message (), rl_clear_message ();
++extern int rl_message (char *, ...);
++extern int rl_clear_message ();
+ extern int rl_reset_line_state ();
+ extern int rl_character_len ();
+ extern int rl_show_char ();
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list