entab did not compile for me (cvs head), as
gcc 3.3.5  #error's on <varargs.h>.

This patch includes <stdarg.h> and also converts
arg declaration to ANSI style, because K&R varargs
are mystery to me.

-- 
marko

Index: src/tools/entab/entab.c
===================================================================
RCS file: /opt/cvs2/pgsql/pgsql/src/tools/entab/entab.c,v
retrieving revision 1.13
diff -u -c -r1.13 entab.c
*** src/tools/entab/entab.c     7 Oct 2003 17:40:09 -0000       1.13
--- src/tools/entab/entab.c     14 Dec 2004 19:58:21 -0000
***************
*** 29,37 ****
  extern int    optind;
  
  int
! main(argc, argv)
! int                   argc;
! char    **argv;
  {
        int                     tab_size = 8,
                                min_spaces = 2,
--- 29,35 ----
  extern int    optind;
  
  int
! main(int argc, char **argv)
  {
        int                     tab_size = 8,
                                min_spaces = 2,
Index: src/tools/entab/halt.c
===================================================================
RCS file: /opt/cvs2/pgsql/pgsql/src/tools/entab/halt.c,v
retrieving revision 1.5
diff -u -c -r1.5 halt.c
*** src/tools/entab/halt.c      22 Mar 2001 04:01:45 -0000      1.5
--- src/tools/entab/halt.c      14 Dec 2004 17:47:13 -0000
***************
*** 5,11 ****
  **            This is used to print out error messages and exit
  */
  
! #include <varargs.h>
  #include <signal.h>
  #include <stdio.h>
  #include <errno.h>
--- 5,11 ----
  **            This is used to print out error messages and exit
  */
  
! #include <stdarg.h>
  #include <signal.h>
  #include <stdio.h>
  #include <errno.h>
***************
*** 19,34 ****
  
  /*VARARGS*/
  void
! halt(va_alist)
! va_dcl
  {
        va_list         arg_ptr;
!       char       *format,
!                          *pstr;
        void            (*sig_func) ();
  
!       va_start(arg_ptr);
!       format = va_arg(arg_ptr, char *);
        if (strncmp(format, "PERROR", 6) != 0)
                vfprintf(stderr, format, arg_ptr);
        else
--- 19,31 ----
  
  /*VARARGS*/
  void
! halt(char *format, ...)
  {
        va_list         arg_ptr;
!       char       *pstr;
        void            (*sig_func) ();
  
!       va_start(arg_ptr, format);
        if (strncmp(format, "PERROR", 6) != 0)
                vfprintf(stderr, format, arg_ptr);
        else
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to