------- Comment #6 from ktietz at gcc dot gnu dot org  2010-03-05 10:04 -------
(In reply to comment #5)

This patch has a problem about the printf formatter definitions in
libgfortran.h header. So I suggest to use the following patch instead.
I am current on to bootstrap it completely and test the given testcases by it
again.

Index: gcc/libgfortran/libgfortran.h
===================================================================
--- gcc.orig/libgfortran/libgfortran.h  2009-12-04 18:22:19.000000000 +0100
+++ gcc/libgfortran/libgfortran.h       2010-03-05 07:44:41.230103300 +0100
@@ -28,6 +28,15 @@ see the files COPYING3 and COPYING.RUNTI
 #ifndef LIBGFOR_H
 #define LIBGFOR_H

+/* Ensure that ANSI conform stdio is used. This needs to be set before
+   any system header file is included.  */
+#if defined __MINGW32__
+#  define _POSIX 1
+#  define gfc_printf gnu_printf
+#else
+#  define gfc_printf __printf__
+#endif
+
 /* config.h MUST be first because it can affect system headers.  */
 #include "config.h"

@@ -703,15 +712,15 @@ extern void show_locus (st_parameter_com
 internal_proto(show_locus);

 extern void runtime_error (const char *, ...)
-     __attribute__ ((noreturn, format (printf, 1, 2)));
+     __attribute__ ((noreturn, format (gfc_printf, 1, 2)));
 iexport_proto(runtime_error);

 extern void runtime_error_at (const char *, const char *, ...)
-     __attribute__ ((noreturn, format (printf, 2, 3)));
+     __attribute__ ((noreturn, format (gfc_printf, 2, 3)));
 iexport_proto(runtime_error_at);

 extern void runtime_warning_at (const char *, const char *, ...)
-     __attribute__ ((format (printf, 2, 3)));
+     __attribute__ ((format (gfc_printf, 2, 3)));
 iexport_proto(runtime_warning_at);

 extern void internal_error (st_parameter_common *, const char *)
@@ -795,7 +804,7 @@ extern int unit_to_fd (int);
 internal_proto(unit_to_fd);

 extern int st_printf (const char *, ...)
-  __attribute__ ((format (printf, 1, 2)));
+  __attribute__ ((format (gfc_printf, 1, 2)));
 internal_proto(st_printf);

 extern int st_vprintf (const char *, va_list);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950

Reply via email to