aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-12-12 08:04:24 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-12-12 08:04:24 -0500
commit37c9f67474a1361512677f00ccf51de259334171 (patch)
tree247ac4fe62cb5ac74d12eb9f31a22079fc2c6548 /gcc
parent9dff20283a4f7ed3a6c0e476b39613a3253dd2eb (diff)
downloadgcc-37c9f67474a1361512677f00ccf51de259334171.zip
gcc-37c9f67474a1361512677f00ccf51de259334171.tar.gz
gcc-37c9f67474a1361512677f00ccf51de259334171.tar.bz2
(vms_fopen): Call `fopen' through an indirect pointer to inhibit checking argument list against its prototype.
(vms_fopen): Call `fopen' through an indirect pointer to inhibit checking argument list against its prototype. Increase RMS multi-block count from 16 to 32. From-SVN: r8644
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cccp.c13
-rw-r--r--gcc/toplev.c19
2 files changed, 23 insertions, 9 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index 0c73637..20bd119 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -9967,9 +9967,16 @@ fopen (fname, type)
char *type;
{
#undef fopen /* Get back the REAL fopen routine */
- if (strcmp (type, "w") == 0)
- return fopen (fname, type, "mbc=16", "deq=64", "fop=tef", "shr=nil");
- return fopen (fname, type, "mbc=16");
+ /* The gcc-vms-1.42 distribution's header files prototype fopen with two
+ fixed arguments, which matches ANSI's specification but not VAXCRTL's
+ pre-ANSI implmentation. This hack circumvents the mismatch problem. */
+ FILE *(*vmslib_fopen)() = (FILE *(*)()) fopen;
+
+ if (*type == 'w')
+ return (*vmslib_fopen) (fname, type, "mbc=32",
+ "deq=64", "fop=tef", "shr=nil");
+ else
+ return (*vmslib_fopen) (fname, type, "mbc=32");
}
static int
diff --git a/gcc/toplev.c b/gcc/toplev.c
index f4dc865..62c34f0 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -71,16 +71,23 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifdef VMS
/* The extra parameters substantially improve the I/O performance. */
static FILE *
-VMS_fopen (fname, type)
+vms_fopen (fname, type)
char * fname;
char * type;
{
- if (strcmp (type, "w") == 0)
- return fopen (fname, type, "mbc=16", "deq=64", "fop=tef", "shr=nil");
- return fopen (fname, type, "mbc=16");
+ /* The <stdio.h> in the gcc-vms-1.42 distribution prototypes fopen with two
+ fixed arguments, which matches ANSI's specification but not VAXCRTL's
+ pre-ANSI implementation. This hack circumvents the mismatch problem. */
+ FILE *(*vmslib_fopen)() = (FILE *(*)()) fopen;
+
+ if (*type == 'w')
+ return (*vmslib_fopen) (fname, type, "mbc=32",
+ "deq=64", "fop=tef", "shr=nil");
+ else
+ return (*vmslib_fopen) (fname, type, "mbc=32");
}
-#define fopen VMS_fopen
-#endif
+#define fopen vms_fopen
+#endif /* VMS */
#ifndef DEFAULT_GDB_EXTENSIONS
#define DEFAULT_GDB_EXTENSIONS 1