[COMMIT] Default to using "b" in fopen()

Mark Kettenis kettenis@gnu.org
Tue Oct 12 10:06:00 GMT 2004


Since everyone seemed to agree on this except for me, I've committed
the attached.  I might actually add some configury magic such that
even pre-ISO C90 libraries are detected when we're not
cross-compiling.  Anyway, this clears the way for some more cleanups
in xm-cygwin.h and xm-go32.h.

Mark


Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.6477
diff -u -p -u -p -r1.6477 ChangeLog
--- ChangeLog	11 Oct 2004 20:03:52 -0000	1.6477
+++ ChangeLog	12 Oct 2004 10:00:35 -0000
@@ -1,3 +1,8 @@
+2004-10-12  Mark Kettenis  <kettenis@gnu.org>
+
+	* defs.h [!FOPEN_RB]: Include "fopen-bin.h" instead of
+	"fopen-same.h".  Update comment.
+
 2004-10-11  Mark Kettenis  <kettenis@gnu.org>
 
 	* i386gnu-nat.c: Include "gdb_string.h".
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.169
diff -u -p -u -p -r1.169 defs.h
--- defs.h	1 Oct 2004 10:23:08 -0000	1.169
+++ defs.h	12 Oct 2004 10:00:35 -0000
@@ -804,11 +804,16 @@ typedef struct ptid ptid_t;
 #include "tm.h"
 #endif
 
-/* If the xm.h file did not define the mode string used to open the
-   files, assume that binary files are opened the same way as text
-   files */
+/* Assume that fopen accepts the letter "b" in the mode string.
+   Support for is demanded by ISO C90, and should be supported on all
+   platforms that claim to have a standards conforming C library.  On
+   true POSIX systems it will be ignored and have no effect.  There
+   may still be systems without a standards conforming C library where
+   an ISO C90 compiler (GCC) is available.  Known examples are SunOS
+   4.x and 4.3BSD.  This assumption means these systems are no longer
+   supported.  */
 #ifndef FOPEN_RB
-#include "fopen-same.h"
+# include "fopen-bin.h"
 #endif
 
 /* Defaults for system-wide constants (if not defined by xm.h, we fake it).



More information about the Gdb-patches mailing list