Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] Re: (PR#3579) When stdarg.h should be included?
Home

[Freeciv-Dev] Re: (PR#3579) When stdarg.h should be included?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#3579) When stdarg.h should be included?
From: "Davide Pagnin" <nightmare@xxxxxxxxxx>
Date: Thu, 27 Mar 2003 13:13:54 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, 2003-03-24 at 01:41, Jason Short wrote:
> [pagnin - Sun Mar  2 12:20:12 2003]:
> 
> > AFAIK, stdarg.h is part of ANSI C standard, and should be included when
> > variable argument lists relevant macros are used.
> 
> ...
> 
> > If there are no objection, I will produce a patch that will implement
> > solution 2.
> 
> Do you have a patch?
> 
> jason
> 

I've prepared the patch, which is attached.

I've tried it with Linux Redhat 7.3 - xaw, gtk1 and 
on Tru64 Unix alpha xaw e gtk1 (with native Compaq cc)

Seems to work without warnings.

Perhaps some more tests with not common OS / arch can be useful.

        Ciao, Davide

diff -urN -Xfreeciv/diff_ignore freeciv/amiga/vsnprintf.c 
freeciv-work/amiga/vsnprintf.c
--- freeciv/amiga/vsnprintf.c   Sun Jan 26 15:00:08 2003
+++ freeciv-work/amiga/vsnprintf.c      Thu Mar 27 16:54:36 2003
@@ -46,10 +46,10 @@
 #endif
 
 #include <limits.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
 
 static char * __ultoa(register unsigned long, char *, int, int, char *);
 static void __find_arguments(const char *, va_list, void ***);
diff -urN -Xfreeciv/diff_ignore freeciv/client/climisc.c 
freeciv-work/client/climisc.c
--- freeciv/client/climisc.c    Thu Mar 27 15:38:05 2003
+++ freeciv-work/client/climisc.c       Thu Mar 27 16:41:26 2003
@@ -23,6 +23,7 @@
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdarg.h>
 #include <string.h>
 
 #ifdef HAVE_UNISTD_H
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk/cityrep.c 
freeciv-work/client/gui-gtk/cityrep.c
--- freeciv/client/gui-gtk/cityrep.c    Thu Mar 27 15:38:05 2003
+++ freeciv-work/client/gui-gtk/cityrep.c       Thu Mar 27 16:42:33 2003
@@ -15,11 +15,10 @@
 #include <config.h>
 #endif
 
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
-#include <assert.h>
 
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk/dialogs.c 
freeciv-work/client/gui-gtk/dialogs.c
--- freeciv/client/gui-gtk/dialogs.c    Thu Mar 27 15:38:05 2003
+++ freeciv-work/client/gui-gtk/dialogs.c       Thu Mar 27 16:42:53 2003
@@ -18,8 +18,8 @@
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 #include <stdarg.h>
+#include <string.h>
 
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk/inteldlg.c 
freeciv-work/client/gui-gtk/inteldlg.c
--- freeciv/client/gui-gtk/inteldlg.c   Fri Nov 15 15:22:43 2002
+++ freeciv-work/client/gui-gtk/inteldlg.c      Thu Mar 27 16:42:09 2003
@@ -17,7 +17,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 
 #include <gtk/gtk.h>
 
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk-2.0/cityrep.c 
freeciv-work/client/gui-gtk-2.0/cityrep.c
--- freeciv/client/gui-gtk-2.0/cityrep.c        Thu Mar 27 15:38:06 2003
+++ freeciv-work/client/gui-gtk-2.0/cityrep.c   Thu Mar 27 16:44:58 2003
@@ -15,11 +15,10 @@
 #include <config.h>
 #endif
 
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
-#include <assert.h>
 
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk-2.0/dialogs.c 
freeciv-work/client/gui-gtk-2.0/dialogs.c
--- freeciv/client/gui-gtk-2.0/dialogs.c        Thu Mar 27 15:38:06 2003
+++ freeciv-work/client/gui-gtk-2.0/dialogs.c   Thu Mar 27 16:43:47 2003
@@ -16,10 +16,10 @@
 #endif
 
 #include <assert.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
 
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk-2.0/gui_main.c 
freeciv-work/client/gui-gtk-2.0/gui_main.c
--- freeciv/client/gui-gtk-2.0/gui_main.c       Thu Mar 27 15:38:06 2003
+++ freeciv-work/client/gui-gtk-2.0/gui_main.c  Thu Mar 27 16:44:18 2003
@@ -19,6 +19,7 @@
 #ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
+#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk-2.0/inteldlg.c 
freeciv-work/client/gui-gtk-2.0/inteldlg.c
--- freeciv/client/gui-gtk-2.0/inteldlg.c       Fri Jan 24 14:50:17 2003
+++ freeciv-work/client/gui-gtk-2.0/inteldlg.c  Thu Mar 27 16:44:47 2003
@@ -17,7 +17,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 
 #include <gtk/gtk.h>
 
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-mui/citydlg.c 
freeciv-work/client/gui-mui/citydlg.c
--- freeciv/client/gui-mui/citydlg.c    Thu Feb  6 23:59:54 2003
+++ freeciv-work/client/gui-mui/citydlg.c       Thu Mar 27 16:45:31 2003
@@ -15,7 +15,6 @@
 #include <config.h>
 #endif
 
-#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-mui/cityrep.c 
freeciv-work/client/gui-mui/cityrep.c
--- freeciv/client/gui-mui/cityrep.c    Tue Feb 25 11:07:03 2003
+++ freeciv-work/client/gui-mui/cityrep.c       Thu Mar 27 16:45:43 2003
@@ -18,7 +18,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
 
 #include <mui/NListview_MCC.h>
 #include <libraries/mui.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-mui/dialogs.c 
freeciv-work/client/gui-mui/dialogs.c
--- freeciv/client/gui-mui/dialogs.c    Thu Feb 13 14:20:56 2003
+++ freeciv-work/client/gui-mui/dialogs.c       Thu Mar 27 16:45:52 2003
@@ -18,7 +18,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
 
 #include <mui/NListview_MCC.h>
 #include <libraries/mui.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-mui/inteldlg.c 
freeciv-work/client/gui-mui/inteldlg.c
--- freeciv/client/gui-mui/inteldlg.c   Fri Nov 15 15:22:44 2002
+++ freeciv-work/client/gui-mui/inteldlg.c      Thu Mar 27 16:45:58 2003
@@ -17,7 +17,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 
 #include <libraries/mui.h>
 #include <mui/NListview_MCC.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-mui/muistuff.c 
freeciv-work/client/gui-mui/muistuff.c
--- freeciv/client/gui-mui/muistuff.c   Fri Nov 15 15:22:44 2002
+++ freeciv-work/client/gui-mui/muistuff.c      Thu Mar 27 16:45:22 2003
@@ -15,9 +15,9 @@
 #include <config.h>
 #endif
 
-#include <stdlib.h>
 #include <stdarg.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include <libraries/mui.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-sdl/cityrep.c 
freeciv-work/client/gui-sdl/cityrep.c
--- freeciv/client/gui-sdl/cityrep.c    Mon Dec  2 09:47:02 2002
+++ freeciv-work/client/gui-sdl/cityrep.c       Thu Mar 27 16:57:47 2003
@@ -14,12 +14,11 @@
 #include <config.h>
 #endif
 
+#include <assert.h>
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
-#include <stdarg.h>
-#include <assert.h>
 
 #include <SDL/SDL.h>
 #include <SDL/SDL_ttf.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-sdl/inteldlg.c 
freeciv-work/client/gui-sdl/inteldlg.c
--- freeciv/client/gui-sdl/inteldlg.c   Mon Dec  2 09:47:03 2002
+++ freeciv-work/client/gui-sdl/inteldlg.c      Thu Mar 27 16:57:57 2003
@@ -15,10 +15,9 @@
 #include <config.h>
 #endif
 
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <ctype.h>
-#include <stdarg.h>
 
 #include <SDL/SDL.h>
 #include <SDL/SDL_ttf.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-win32/cityrep.c 
freeciv-work/client/gui-win32/cityrep.c
--- freeciv/client/gui-win32/cityrep.c  Tue Feb 25 11:07:07 2003
+++ freeciv-work/client/gui-win32/cityrep.c     Thu Mar 27 16:46:56 2003
@@ -18,7 +18,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
                          
 #include <windows.h>
 #include <windowsx.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-win32/dialogs.c 
freeciv-work/client/gui-win32/dialogs.c
--- freeciv/client/gui-win32/dialogs.c  Thu Mar 27 15:38:09 2003
+++ freeciv-work/client/gui-win32/dialogs.c     Thu Mar 27 16:46:48 2003
@@ -15,9 +15,9 @@
 #include <config.h>
 #endif
 
-#include <string.h>
-#include <stdarg.h>
 #include <assert.h>
+#include <stdarg.h>
+#include <string.h>
 #include <windows.h>
 #include <windowsx.h>
  
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-win32/inteldlg.c 
freeciv-work/client/gui-win32/inteldlg.c
--- freeciv/client/gui-win32/inteldlg.c Fri Nov 15 15:22:44 2002
+++ freeciv-work/client/gui-win32/inteldlg.c    Thu Mar 27 16:47:03 2003
@@ -17,7 +17,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 
 #include <windows.h>
 #include <windowsx.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-win32/messagedlg.c 
freeciv-work/client/gui-win32/messagedlg.c
--- freeciv/client/gui-win32/messagedlg.c       Fri Nov 15 15:22:44 2002
+++ freeciv-work/client/gui-win32/messagedlg.c  Thu Mar 27 16:47:18 2003
@@ -17,7 +17,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 
 #include <windows.h>
 #include <windowsx.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-win32/ratesdlg.c 
freeciv-work/client/gui-win32/ratesdlg.c
--- freeciv/client/gui-win32/ratesdlg.c Fri Nov 15 15:22:44 2002
+++ freeciv-work/client/gui-win32/ratesdlg.c    Thu Mar 27 16:47:11 2003
@@ -17,7 +17,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>     
 #include <windows.h>
 #include <windowsx.h>
 
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-xaw/cityrep.c 
freeciv-work/client/gui-xaw/cityrep.c
--- freeciv/client/gui-xaw/cityrep.c    Tue Feb 25 11:07:07 2003
+++ freeciv-work/client/gui-xaw/cityrep.c       Thu Mar 27 16:47:55 2003
@@ -15,10 +15,9 @@
 #include <config.h>
 #endif
 
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
-#include <assert.h>
 
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-xaw/dialogs.c 
freeciv-work/client/gui-xaw/dialogs.c
--- freeciv/client/gui-xaw/dialogs.c    Tue Feb 25 11:07:07 2003
+++ freeciv-work/client/gui-xaw/dialogs.c       Thu Mar 27 16:47:45 2003
@@ -16,9 +16,9 @@
 #endif
 
 #include <assert.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-xaw/inteldlg.c 
freeciv-work/client/gui-xaw/inteldlg.c
--- freeciv/client/gui-xaw/inteldlg.c   Fri Nov 15 15:22:45 2002
+++ freeciv-work/client/gui-xaw/inteldlg.c      Thu Mar 27 16:48:01 2003
@@ -17,7 +17,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-xaw/messagedlg.c 
freeciv-work/client/gui-xaw/messagedlg.c
--- freeciv/client/gui-xaw/messagedlg.c Fri Nov 15 15:22:45 2002
+++ freeciv-work/client/gui-xaw/messagedlg.c    Thu Mar 27 16:48:15 2003
@@ -17,7 +17,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-xaw/optiondlg.c 
freeciv-work/client/gui-xaw/optiondlg.c
--- freeciv/client/gui-xaw/optiondlg.c  Wed Jan 29 14:16:15 2003
+++ freeciv-work/client/gui-xaw/optiondlg.c     Thu Mar 27 16:48:07 2003
@@ -17,7 +17,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-xaw/ratesdlg.c 
freeciv-work/client/gui-xaw/ratesdlg.c
--- freeciv/client/gui-xaw/ratesdlg.c   Fri Nov 15 15:22:45 2002
+++ freeciv-work/client/gui-xaw/ratesdlg.c      Thu Mar 27 16:48:38 2003
@@ -17,7 +17,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-xaw/repodlgs.c 
freeciv-work/client/gui-xaw/repodlgs.c
--- freeciv/client/gui-xaw/repodlgs.c   Thu Dec 12 23:11:07 2002
+++ freeciv-work/client/gui-xaw/repodlgs.c      Thu Mar 27 16:48:24 2003
@@ -15,11 +15,10 @@
 #include <config.h>
 #endif
 
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
-#include <assert.h>
 
 #include <X11/Intrinsic.h>
 #include <X11/Shell.h>
diff -urN -Xfreeciv/diff_ignore freeciv/common/ioz.c freeciv-work/common/ioz.c
--- freeciv/common/ioz.c        Thu Dec 12 23:11:07 2002
+++ freeciv-work/common/ioz.c   Thu Mar 27 16:50:17 2003
@@ -33,10 +33,10 @@
 #include <config.h>
 #endif
 
-#include <stdio.h>
+#include <errno.h>
 #include <stdarg.h>
+#include <stdio.h>
 #include <string.h>
-#include <errno.h>
 
 #ifdef HAVE_LIBZ
 #include <zlib.h>
diff -urN -Xfreeciv/diff_ignore freeciv/common/log.c freeciv-work/common/log.c
--- freeciv/common/log.c        Tue Feb 25 11:07:07 2003
+++ freeciv-work/common/log.c   Thu Mar 27 16:50:25 2003
@@ -15,8 +15,8 @@
 #include <config.h>
 #endif
 
-#include <stdio.h>
 #include <stdarg.h>
+#include <stdio.h>
 #include <string.h>
 
 #include "fcintl.h"
diff -urN -Xfreeciv/diff_ignore freeciv/common/registry.c 
freeciv-work/common/registry.c
--- freeciv/common/registry.c   Fri Jan 24 14:50:20 2003
+++ freeciv-work/common/registry.c      Thu Mar 27 16:50:46 2003
@@ -148,11 +148,11 @@
 #include <config.h>
 #endif
 
+#include <assert.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
-#include <assert.h>
 
 #include "astring.h"
 #include "genlist.h"
diff -urN -Xfreeciv/diff_ignore freeciv/common/shared.c 
freeciv-work/common/shared.c
--- freeciv/common/shared.c     Thu Mar 27 15:38:11 2003
+++ freeciv-work/common/shared.c        Thu Mar 27 16:51:39 2003
@@ -23,6 +23,7 @@
 #include <dirent.h>
 #include <errno.h>
 #include <limits.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff -urN -Xfreeciv/diff_ignore freeciv/common/support.c 
freeciv-work/common/support.c
--- freeciv/common/support.c    Thu Mar 27 15:38:11 2003
+++ freeciv-work/common/support.c       Thu Mar 27 16:51:12 2003
@@ -43,11 +43,11 @@
 
 #include <assert.h>
 #include <ctype.h>
-#include <stdio.h>
+#include <errno.h>
 #include <stdarg.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <errno.h>
 #include <sys/stat.h>
 
 #ifdef HAVE_UNISTD_H
diff -urN -Xfreeciv/diff_ignore freeciv/common/support.h 
freeciv-work/common/support.h
--- freeciv/common/support.h    Tue Nov 12 15:06:56 2002
+++ freeciv-work/common/support.h       Thu Mar 27 16:56:35 2003
@@ -20,8 +20,8 @@
   See also mem.h, netintf.h, rand.h, and see support.c for more comments.
 ***********************************************************************/
 
-#include <stdlib.h>            /* size_t */
 #include <stdarg.h>
+#include <stdlib.h>            /* size_t */
 
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
diff -urN -Xfreeciv/diff_ignore freeciv/server/console.c 
freeciv-work/server/console.c
--- freeciv/server/console.c    Fri Dec 20 11:30:52 2002
+++ freeciv-work/server/console.c       Thu Mar 27 16:52:02 2003
@@ -15,8 +15,8 @@
 #include <config.h>
 #endif
 
-#include <stdio.h>
 #include <stdarg.h>
+#include <stdio.h>
 #include <string.h>
 
 #ifdef HAVE_LIBREADLINE
diff -urN -Xfreeciv/diff_ignore freeciv/server/gamelog.c 
freeciv-work/server/gamelog.c
--- freeciv/server/gamelog.c    Fri Jan 24 14:50:25 2003
+++ freeciv-work/server/gamelog.c       Thu Mar 27 16:52:09 2003
@@ -15,9 +15,9 @@
 #include <config.h>
 #endif
 
+#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 #include <string.h>
 
 #include "fcintl.h"
diff -urN -Xfreeciv/diff_ignore freeciv/server/plrhand.c 
freeciv-work/server/plrhand.c
--- freeciv/server/plrhand.c    Thu Mar 27 15:39:15 2003
+++ freeciv-work/server/plrhand.c       Thu Mar 27 16:52:27 2003
@@ -16,6 +16,7 @@
 #endif
 
 #include <assert.h>
+#include <stdarg.h>
 
 #include "events.h"
 #include "fcintl.h"
diff -urN -Xfreeciv/diff_ignore freeciv/server/stdinhand.c 
freeciv-work/server/stdinhand.c
--- freeciv/server/stdinhand.c  Thu Mar 27 15:39:15 2003
+++ freeciv-work/server/stdinhand.c     Thu Mar 27 16:52:47 2003
@@ -15,11 +15,11 @@
 #include <config.h>
 #endif
 
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
 #include <assert.h>
 #include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #ifdef HAVE_LIBREADLINE
 #include <readline/readline.h>

[Prev in Thread] Current Thread [Next in Thread]