aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1998-03-22 03:36:19 -0700
committerJeff Law <law@gcc.gnu.org>1998-03-22 03:36:19 -0700
commit0cc6110ba1f913e3234119f7181351a36f19af2c (patch)
treecaeb7003e5e191471601e06a5b6453c33af880b4
parentd8e1ac71a32f539c1f52c51553afb51675537c53 (diff)
Import of g77-0.5.22
From-SVN: r18756
-rw-r--r--libf2c/ChangeLog64
-rw-r--r--libf2c/changes.netlib11
-rwxr-xr-xlibf2c/configure217
-rw-r--r--libf2c/configure.in15
-rw-r--r--libf2c/f2cext.c6
-rw-r--r--libf2c/libF77/Version.c6
-rw-r--r--libf2c/libF77/dtime_.c2
-rw-r--r--libf2c/libF77/etime_.c2
-rw-r--r--libf2c/libF77/signal_.c9
-rw-r--r--libf2c/libI77/Version.c12
-rw-r--r--libf2c/libI77/close.c7
-rw-r--r--libf2c/libI77/err.c6
-rw-r--r--libf2c/libI77/fio.h3
-rw-r--r--libf2c/libI77/fmt.c45
-rw-r--r--libf2c/libI77/fmt.h8
-rw-r--r--libf2c/libI77/lread.c2
-rw-r--r--libf2c/libI77/open.c8
-rw-r--r--libf2c/libI77/rdfmt.c6
-rw-r--r--libf2c/libI77/wrtfmt.c16
-rw-r--r--libf2c/libU77/Version.c4
-rw-r--r--libf2c/libU77/chmod_.c7
-rw-r--r--libf2c/libU77/dtime_.c14
-rw-r--r--libf2c/readme.netlib11
23 files changed, 350 insertions, 131 deletions
diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog
index 57b175eaf6a..3e890556c43 100644
--- a/libf2c/ChangeLog
+++ b/libf2c/ChangeLog
@@ -1,3 +1,61 @@
+Sat Feb 28 15:32:15 1998 Craig Burley <burley@gnu.org>
+
+ * libI77/open.c (f_open): Use sizeof(buf) instead of
+ 256, for the usual reasons.
+
+Tue Dec 23 22:56:01 1997 Craig Burley <burley@gnu.org>
+
+ * libF77/signal_.c (G77_signal_0): Return type is
+ now `void *', to cope with returning previous signal
+ handler on 64-bit systems like Alphas.
+ * f2cext.c (signal_): Changed accordingly.
+
+Wed Oct 29 01:01:04 1997 Mumit Khan <khan@brahma.xraylith.wisc.edu>
+
+ * configure.in: Set CC to CC_FOR_TARGET when cross-compiling.
+
+Fri Oct 24 11:15:22 1997 Mumit Khan <khan@brahma.xraylith.wisc.edu>
+
+ * libI77/close.c (f_exit): Reset f__init so that f_clos does not
+ (incorrectly) think there is an I/O recursion when program is
+ interrupted.
+
+Wed Oct 15 10:06:29 1997 Richard Henderson <rth@cygnus.com>
+
+ * libI77/fio.h: Include <string.h> if STDC_HEADERS.
+ * libU77/chmod_.c: Likewise.
+
+Tue Sep 30 00:41:39 1997 Craig Burley <burley@gnu.ai.mit.edu>
+
+ Do a better job of printing the offending FORMAT string
+ when producing a diagnostic:
+ * libI77/err.c (f__fmtlen): New variable to hold operating
+ length of format string.
+ (f__fatal): Use new variable to limit length of printed string.
+ * libI77/fmt.c (f_s): Don't skip spaces after closing paren,
+ so nicer message results (and nested case already skips them).
+ (pars_f): Record operating length of format string as indicated
+ by a successful call to f_s, or ad-hoc-calculate it if failure,
+ limiting the length to 80 characters (and stopping at NUL).
+ (do_fio): Use new variable to limit length of printed string.
+ * libI77/fmt.h (f__fmtlen): Declare new variable.
+ * libI77/lread.c (c_le): Set new variable to known length.
+
+Mon Sep 29 16:30:31 1997 Craig Burley <burley@gnu.ai.mit.edu>
+
+ Update to Netlib version of 1997-09-23:
+ * libF77/dtime_.c (dtime_), libF77/etime_.c (dtime_):
+ Return `double' instead of `float' (these are not used
+ in g77's version of libf2c).
+ * libI77/fmt.c, libI77/fmt.h, libI77/rdfmt.c, libI77/wrtfmt.c:
+ Support machines with 64-bit pointers and 32-bit ints (e.g.
+ Linux on DEC Alpha).
+
+1997-09-19 Dave Love <d.love@dl.ac.uk>
+
+ * libU77/dtime_.c (G77_dtime_0): Fix types in HAVE_GETRUSAGE case
+ so as not to truncate results to integer values.
+
Tue Sep 9 00:33:24 1997 Craig Burley <burley@gnu.ai.mit.edu>
* Version 0.5.21 released.
@@ -490,6 +548,12 @@ Thu Oct 31 22:27:45 1996 Craig Burley <burley@gnu.ai.mit.edu>
* libI77/Version.c: Use <stdio.h>, not "stdio.h".
* libF77/Version.c: Likewise.
+1997-10-03 Dave Love <d.love@dl.ac.uk>
+
+ * configure.in: Check for tempnam (best because it obeys TMPDIR).
+ * libI77/open.c: Use it.
+ * libI77/err.c: New message # 132.
+
Wed Aug 28 13:25:29 1996 Dave Love <d.love@dl.ac.uk>
* libI77/rsne.c (x_rsne): Use size_t instead of int.
diff --git a/libf2c/changes.netlib b/libf2c/changes.netlib
index 1827154b591..78dba8653ba 100644
--- a/libf2c/changes.netlib
+++ b/libf2c/changes.netlib
@@ -2836,6 +2836,15 @@ with F8X_NML_ELIDE_QUOTES #defined. wrtfmt.o: wrt_G: tweak to print
the right number of 0's for zero under G format.
Sat Aug 16 05:45:32 EDT 1997
- libI77: iio.c: fix bug in internal writes to an array of character
+ libi77: iio.c: fix bug in internal writes to an array of character
strings that sometimes caused one more array element than required by
the format to be blank-filled. Example: format(1x).
+
+Wed Sep 17 00:39:29 EDT 1997
+ libi77: fmt.[ch] rdfmt.c wrtfmt.c: tweak struct syl for machines
+with 64-bit pointers and 32-bit ints that did not 64-bit align
+struct syl (e.g., Linux on the DEC Alpha). This change should be
+invisible on other machines.
+
+Sun Sep 21 22:05:19 EDT 1997
+ libf77: [de]time_.c (Unix systems only): change return type to double.
diff --git a/libf2c/configure b/libf2c/configure
index 9d7b6f5069f..8c3966f2480 100755
--- a/libf2c/configure
+++ b/libf2c/configure
@@ -521,12 +521,20 @@ fi
# From configure.in 1.10
-# For g77 we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-# Extract the first word of "gcc", so it can be a program name with args.
+if test "$CROSS";then
+ if test "$CC_FOR_TARGET"; then
+ CC="$CC_FOR_TARGET"
+ else
+ CC="../../xgcc -B../../xgcc/"
+ fi
+ ac_cv_c_cross=yes
+else
+ # For g77 we'll set CC to point at the built gcc, but this will get it into
+ # the makefiles
+ # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:530: checking for $ac_word" >&5
+echo "configure:538: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -555,7 +563,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:559: checking for $ac_word" >&5
+echo "configure:567: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -603,7 +611,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:607: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:615: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -613,11 +621,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 617 "configure"
+#line 625 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -637,12 +645,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:641: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:649: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:646: checking whether we are using GNU C" >&5
+echo "configure:654: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -651,7 +659,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -666,7 +674,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:670: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:678: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -693,9 +701,6 @@ else
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
-if test "$CROSS";then
- ac_cv_c_cross=yes
-else
ac_cv_c_cross=no
fi
@@ -711,7 +716,7 @@ else
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:715: checking for $ac_word" >&5
+echo "configure:720: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -744,7 +749,7 @@ fi
# Sanity check for the cross-compilation case:
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:748: checking how to run the C preprocessor" >&5
+echo "configure:753: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -759,13 +764,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 763 "configure"
+#line 768 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -776,13 +781,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 780 "configure"
+#line 785 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -806,17 +811,17 @@ echo "$ac_t""$CPP" 1>&6
ac_safe=`echo "stdio.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for stdio.h""... $ac_c" 1>&6
-echo "configure:810: checking for stdio.h" >&5
+echo "configure:815: checking for stdio.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 815 "configure"
+#line 820 "configure"
#include "confdefs.h"
#include <stdio.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -844,12 +849,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:848: checking for ANSI C header files" >&5
+echo "configure:853: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 853 "configure"
+#line 858 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -857,7 +862,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -874,7 +879,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 878 "configure"
+#line 883 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -892,7 +897,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 896 "configure"
+#line 901 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -913,7 +918,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 917 "configure"
+#line 922 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -924,7 +929,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
@@ -950,12 +955,12 @@ fi
echo $ac_n "checking for posix""... $ac_c" 1>&6
-echo "configure:954: checking for posix" >&5
+echo "configure:959: checking for posix" >&5
if eval "test \"`echo '$''{'g77_cv_header_posix'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 959 "configure"
+#line 964 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <unistd.h>
@@ -981,12 +986,12 @@ echo "$ac_t""$g77_cv_header_posix" 1>&6
# We can rely on the GNU library being posix-ish. I guess checking the
# header isn't actually like checking the functions, though...
echo $ac_n "checking for GNU library""... $ac_c" 1>&6
-echo "configure:985: checking for GNU library" >&5
+echo "configure:990: checking for GNU library" >&5
if eval "test \"`echo '$''{'g77_cv_lib_gnu'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 990 "configure"
+#line 995 "configure"
#include "confdefs.h"
#include <stdio.h>
#ifdef __GNU_LIBRARY__
@@ -1010,12 +1015,12 @@ echo "$ac_t""$g77_cv_lib_gnu" 1>&6
# Apparently cygwin needs to be special-cased.
echo $ac_n "checking for cyg\`win'32""... $ac_c" 1>&6
-echo "configure:1014: checking for cyg\`win'32" >&5
+echo "configure:1019: checking for cyg\`win'32" >&5
if eval "test \"`echo '$''{'g77_cv_sys_cygwin32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1019 "configure"
+#line 1024 "configure"
#include "confdefs.h"
#ifdef __CYGWIN32__
yes
@@ -1038,17 +1043,17 @@ echo "$ac_t""$g77_cv_sys_cygwin32" 1>&6
ac_safe=`echo "fcntl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for fcntl.h""... $ac_c" 1>&6
-echo "configure:1042: checking for fcntl.h" >&5
+echo "configure:1047: checking for fcntl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1047 "configure"
+#line 1052 "configure"
#include "confdefs.h"
#include <fcntl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1052: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1081,12 +1086,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1085: checking for working const" >&5
+echo "configure:1090: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1090 "configure"
+#line 1095 "configure"
#include "confdefs.h"
int main() {
@@ -1135,7 +1140,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1156,12 +1161,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1160: checking for size_t" >&5
+echo "configure:1165: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1165 "configure"
+#line 1170 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1190,12 +1195,12 @@ fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1194: checking return type of signal handlers" >&5
+echo "configure:1199: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1199 "configure"
+#line 1204 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -1212,7 +1217,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:1216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -1233,12 +1238,12 @@ EOF
# we'll get atexit by default
if test $ac_cv_header_stdc != yes; then
echo $ac_n "checking for atexit""... $ac_c" 1>&6
-echo "configure:1237: checking for atexit" >&5
+echo "configure:1242: checking for atexit" >&5
if eval "test \"`echo '$''{'ac_cv_func_atexit'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1242 "configure"
+#line 1247 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char atexit(); below. */
@@ -1261,7 +1266,7 @@ atexit();
; return 0; }
EOF
-if { (eval echo configure:1265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_atexit=yes"
else
@@ -1286,12 +1291,12 @@ else
EOF
echo $ac_n "checking for onexit""... $ac_c" 1>&6
-echo "configure:1290: checking for onexit" >&5
+echo "configure:1295: checking for onexit" >&5
if eval "test \"`echo '$''{'ac_cv_func_onexit'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1295 "configure"
+#line 1300 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char onexit(); below. */
@@ -1314,7 +1319,7 @@ onexit();
; return 0; }
EOF
-if { (eval echo configure:1318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_onexit=yes"
else
@@ -1332,12 +1337,12 @@ if eval "test \"`echo '$ac_cv_func_'onexit`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for on_exit""... $ac_c" 1>&6
-echo "configure:1336: checking for on_exit" >&5
+echo "configure:1341: checking for on_exit" >&5
if eval "test \"`echo '$''{'ac_cv_func_on_exit'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1341 "configure"
+#line 1346 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char on_exit(); below. */
@@ -1360,7 +1365,7 @@ on_exit();
; return 0; }
EOF
-if { (eval echo configure:1364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_on_exit=yes"
else
@@ -1393,12 +1398,12 @@ fi
# Apparently positive result on cygwin loses re. NON_UNIX_STDIO
# (as of cygwin b18).
echo $ac_n "checking for fstat""... $ac_c" 1>&6
-echo "configure:1397: checking for fstat" >&5
+echo "configure:1402: checking for fstat" >&5
if eval "test \"`echo '$''{'ac_cv_func_fstat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1402 "configure"
+#line 1407 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char fstat(); below. */
@@ -1421,7 +1426,7 @@ fstat();
; return 0; }
EOF
-if { (eval echo configure:1425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_fstat=yes"
else
@@ -1441,7 +1446,7 @@ else
fi
echo $ac_n "checking need for NON_UNIX_STDIO""... $ac_c" 1>&6
-echo "configure:1445: checking need for NON_UNIX_STDIO" >&5
+echo "configure:1450: checking need for NON_UNIX_STDIO" >&5
if test $g77_cv_sys_cygwin32 = yes || test $ac_cv_func_fstat = no; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
@@ -1454,19 +1459,19 @@ fi
# This is necessary for e.g. Linux:
echo $ac_n "checking for necessary members of struct FILE""... $ac_c" 1>&6
-echo "configure:1458: checking for necessary members of struct FILE" >&5
+echo "configure:1463: checking for necessary members of struct FILE" >&5
if eval "test \"`echo '$''{'g77_cv_struct_FILE'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1463 "configure"
+#line 1468 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE s; s._ptr; s._base; s._flag;
; return 0; }
EOF
-if { (eval echo configure:1470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
g77_cv_struct_FILE=yes
else
@@ -1486,7 +1491,7 @@ EOF
fi
echo $ac_n "checking for drem in -lm""... $ac_c" 1>&6
-echo "configure:1490: checking for drem in -lm" >&5
+echo "configure:1495: checking for drem in -lm" >&5
ac_lib_var=`echo m'_'drem | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1494,7 +1499,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1498 "configure"
+#line 1503 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1505,7 +1510,7 @@ int main() {
drem()
; return 0; }
EOF
-if { (eval echo configure:1509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1530,24 +1535,80 @@ fi
+for ac_func in tempnam
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1542: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1547 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
# posix will guarantee the right behaviour for sprintf, else we can't be
# sure; HEADER_STDC wouldn't be the right check in sunos4, for instance.
# However, on my sunos4/gcc setup unistd.h leads us wrongly to believe
# we're posix-conformant, so always do the test.
echo $ac_n "checking for ansi/posix sprintf result""... $ac_c" 1>&6
-echo "configure:1539: checking for ansi/posix sprintf result" >&5
+echo "configure:1600: checking for ansi/posix sprintf result" >&5
if test "$cross_compiling" = yes; then
g77_cv_sys_sprintf_ansi=no
else
cat > conftest.$ac_ext <<EOF
-#line 1544 "configure"
+#line 1605 "configure"
#include "confdefs.h"
#include <stdio.h>
/* does sprintf return the number of chars transferred? */
main () {char foo[2]; (sprintf(foo, "1") == 1) ? exit(0) : exit(1);}
EOF
-if { (eval echo configure:1551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
g77_cv_sys_sprintf_ansi=yes
else
@@ -1581,9 +1642,9 @@ fi
# define NON_ANSI_RW_MODES on unix (can't hurt)
echo $ac_n "checking NON_ANSI_RW_MODES""... $ac_c" 1>&6
-echo "configure:1585: checking NON_ANSI_RW_MODES" >&5
+echo "configure:1646: checking NON_ANSI_RW_MODES" >&5
cat > conftest.$ac_ext <<EOF
-#line 1587 "configure"
+#line 1648 "configure"
#include "confdefs.h"
#ifdef unix
yes
@@ -1624,14 +1685,14 @@ fi
# (via com.h). proj.h and com.h are in $srcdir/.., config.h which they need
# is in ../.. and the config files are in $srcdir/../../config.
echo $ac_n "checking f2c integer type""... $ac_c" 1>&6
-echo "configure:1628: checking f2c integer type" >&5
+echo "configure:1689: checking f2c integer type" >&5
late_ac_cpp=$ac_cpp
ac_cpp="$late_ac_cpp -I$srcdir/.. -I../.. -I$srcdir/../.. -I$srcdir/../../config"
if eval "test \"`echo '$''{'g77_cv_sys_f2cinteger'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1635 "configure"
+#line 1696 "configure"
#include "confdefs.h"
#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
@@ -1654,7 +1715,7 @@ rm -f conftest*
if test "$g77_cv_sys_f2cinteger" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 1658 "configure"
+#line 1719 "configure"
#include "confdefs.h"
#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
@@ -1689,14 +1750,14 @@ ac_cpp=$late_ac_cpp
echo $ac_n "checking f2c long int type""... $ac_c" 1>&6
-echo "configure:1693: checking f2c long int type" >&5
+echo "configure:1754: checking f2c long int type" >&5
late_ac_cpp=$ac_cpp
ac_cpp="$late_ac_cpp -I$srcdir/.. -I../.. -I$srcdir/../.. -I$srcdir/../../config"
if eval "test \"`echo '$''{'g77_cv_sys_f2clongint'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1700 "configure"
+#line 1761 "configure"
#include "confdefs.h"
#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
@@ -1719,7 +1780,7 @@ rm -f conftest*
if test "$g77_cv_sys_f2clongint" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 1723 "configure"
+#line 1784 "configure"
#include "confdefs.h"
#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
diff --git a/libf2c/configure.in b/libf2c/configure.in
index 7b1ed2cd0f8..9d5ce3923e7 100644
--- a/libf2c/configure.in
+++ b/libf2c/configure.in
@@ -23,15 +23,20 @@ AC_INIT(libF77/Version.c)
AC_REVISION(1.10)
-dnl Checks for programs.
-# For g77 we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-AC_PROG_CC
dnl AC_C_CROSS
dnl Gives misleading `(cached)' message from the check.
if test "$CROSS";then
+ if test "$CC_FOR_TARGET"; then
+ CC="$CC_FOR_TARGET"
+ else
+ CC="../../xgcc -B../../xgcc/"
+ fi
ac_cv_c_cross=yes
else
+ dnl Checks for programs.
+ # For g77 we'll set CC to point at the built gcc, but this will get it into
+ # the makefiles
+ AC_PROG_CC
ac_cv_c_cross=no
fi
@@ -172,6 +177,8 @@ dnl test $ac_cv_func_symlink = yes && SYMLNK=symlnk_.o
dnl test $ac_cv_func_lstat = yes && SYMLNK="$SYMLNK lstat_.o"
dnl AC_SUBST(SYMLNK)
+AC_CHECK_FUNCS(tempnam)
+
# posix will guarantee the right behaviour for sprintf, else we can't be
# sure; HEADER_STDC wouldn't be the right check in sunos4, for instance.
# However, on my sunos4/gcc setup unistd.h leads us wrongly to believe
diff --git a/libf2c/f2cext.c b/libf2c/f2cext.c
index d5ac815c9b4..fa1eff7e197 100644
--- a/libf2c/f2cext.c
+++ b/libf2c/f2cext.c
@@ -18,7 +18,7 @@ Boston, MA 02111-1307, USA. */
#include <f2c.h>
-typedef int (*sig_proc)(int);
+typedef void *sig_proc; /* For now, this will have to do. */
#ifdef Labort
int abort_ (void) {
@@ -98,8 +98,8 @@ ftnint iargc_ (void) {
#endif
#ifdef Lsignal
-ftnint signal_ (integer *sigp, sig_proc proc) {
- extern ftnint G77_signal_0 (integer *sigp, sig_proc proc);
+void *signal_ (integer *sigp, sig_proc proc) {
+ extern void *G77_signal_0 (integer *sigp, sig_proc proc);
return G77_signal_0 (sigp, proc);
}
#endif
diff --git a/libf2c/libF77/Version.c b/libf2c/libF77/Version.c
index 8644f3f8187..4f7df49982c 100644
--- a/libf2c/libF77/Version.c
+++ b/libf2c/libF77/Version.c
@@ -1,9 +1,9 @@
-static char junk[] = "\n@(#)LIBF77 VERSION 19970404\n";
+static char junk[] = "\n@(#)LIBF77 VERSION 19970919\n";
/*
*/
-char __G77_LIBF77_VERSION__[] = "0.5.21";
+char __G77_LIBF77_VERSION__[] = "0.5.22";
/*
2.00 11 June 1980. File version.c added to library.
@@ -53,6 +53,8 @@ char __G77_LIBF77_VERSION__[] = "0.5.21";
benefit of g77.)
4 April 1997: [cz]_div.c: tweaks invisible on most systems (that may
affect systems using gratuitous extra precision).
+ 19 Sept. 1997: [de]time_.c (Unix systems only): change return
+ type to double.
*/
#include <stdio.h>
diff --git a/libf2c/libF77/dtime_.c b/libf2c/libF77/dtime_.c
index 2e775c6b84e..79b6735b13b 100644
--- a/libf2c/libF77/dtime_.c
+++ b/libf2c/libF77/dtime_.c
@@ -15,7 +15,7 @@
#endif
#endif
- float
+ double
#ifdef KR_headers
dtime_(tarray) float *tarray;
#else
diff --git a/libf2c/libF77/etime_.c b/libf2c/libF77/etime_.c
index 0fb658af43c..04528b50bb8 100644
--- a/libf2c/libF77/etime_.c
+++ b/libf2c/libF77/etime_.c
@@ -15,7 +15,7 @@
#endif
#endif
- float
+ double
#ifdef KR_headers
etime_(tarray) float *tarray;
#else
diff --git a/libf2c/libF77/signal_.c b/libf2c/libF77/signal_.c
index 1ac81391aef..efd969b672d 100644
--- a/libf2c/libF77/signal_.c
+++ b/libf2c/libF77/signal_.c
@@ -2,13 +2,16 @@
#include "signal1.h"
#ifdef KR_headers
-ftnint G77_signal_0 (sigp, proc) integer *sigp; sig_pf proc;
+void *
+G77_signal_0 (sigp, proc) integer *sigp; sig_pf proc;
#else
-ftnint G77_signal_0 (integer *sigp, sig_pf proc)
+void *
+G77_signal_0 (integer *sigp, sig_pf proc)
#endif
{
int sig;
sig = (int)*sigp;
- return (ftnint)signal(sig, proc);
+ return (void *) signal(sig, proc);
}
+
diff --git a/libf2c/libI77/Version.c b/libf2c/libI77/Version.c
index cbb63c9250a..6fdf19e4654 100644
--- a/libf2c/libI77/Version.c
+++ b/libf2c/libI77/Version.c
@@ -1,9 +1,9 @@
-static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19970816\n";
+static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19970916\n";
/*
*/
-char __G77_LIBI77_VERSION__[] = "0.5.21";
+char __G77_LIBI77_VERSION__[] = "0.5.22";
/*
2.01 $ format added
@@ -264,6 +264,14 @@ wrtfmt.c:
strings that sometimes caused one more array element than
required by the format to be blank-filled. Example:
format(1x). */
+/* 16 Sept. 1997:fmt.[ch] rdfmt.c wrtfmt.c: tweak struct syl for machines
+ with 64-bit pointers and 32-bit ints that did not 64-bit
+ align struct syl (e.g., Linux on the DEC Alpha). */
+
+
+
+/* Changes for GNU Fortran (g77) version of libf2c: */
+
/* 17 June 1997: detect recursive I/O and call f__fatal explaining it. */
#include <stdio.h>
diff --git a/libf2c/libI77/close.c b/libf2c/libI77/close.c
index 691f931a3c0..5c3af4c0854 100644
--- a/libf2c/libI77/close.c
+++ b/libf2c/libI77/close.c
@@ -75,6 +75,13 @@ f_exit(void)
static cllist xx;
if (! (f__init & 1))
return; /* Not initialized, so no open units. */
+ /* I/O no longer in progress. If, during an I/O operation (such
+ as waiting for the user to enter a line), there is an
+ interrupt (such as ^C to stop the program on a UNIX system),
+ f_exit() is called, but there is no longer any I/O in
+ progress. Without turning off this flag, f_clos() would
+ think that there is an I/O recursion in this circumstance. */
+ f__init &= ~2;
if (!xx.cerr) {
xx.cerr=1;
xx.csta=NULL;
diff --git a/libf2c/libI77/err.c b/libf2c/libI77/err.c
index 1d0188737be..cb40630059d 100644
--- a/libf2c/libI77/err.c
+++ b/libf2c/libI77/err.c
@@ -27,6 +27,7 @@ icilist *f__svic; /*active internal io list*/
flag f__reading; /*1 if reading, 0 if writing*/
flag f__cplus,f__cblank;
char *f__fmtbuf;
+int f__fmtlen;
flag f__external; /*1 if external io, 0 if internal */
#ifdef KR_headers
int (*f__doed)(),(*f__doned)();
@@ -79,7 +80,8 @@ char *F_err[] =
"'new' file exists", /* 128 */
"can't append to file", /* 129 */
"non-positive record number", /* 130 */
- "I/O started while already doing I/O" /* 131 */
+ "I/O started while already doing I/O", /* 131 */
+ "Temporary file name (TMPDIR?) too long" /* 132 */
};
#define MAXERR (sizeof(F_err)/sizeof(char *)+100)
@@ -167,7 +169,7 @@ f__fatal(int n, char *s)
else
fprintf(stderr,"apparent state: internal I/O\n");
if (f__fmtbuf)
- fprintf(stderr,"last format: %s\n",f__fmtbuf);
+ fprintf(stderr,"last format: %.*s\n",f__fmtlen,f__fmtbuf);
fprintf(stderr,"lately %s %s %s %s",f__reading?"reading":"writing",
f__sequential?"sequential":"direct",f__formatted?"formatted":"unformatted",
f__external?"external":"internal");
diff --git a/libf2c/libI77/fio.h b/libf2c/libI77/fio.h
index 769d360a626..e9e3b391407 100644
--- a/libf2c/libI77/fio.h
+++ b/libf2c/libI77/fio.h
@@ -4,6 +4,9 @@
/* ANSI C */
#include <stddef.h>
#endif
+#ifdef STDC_HEADERS
+#include <string.h>
+#endif
#ifndef SEEK_SET
#define SEEK_SET 0
diff --git a/libf2c/libI77/fmt.c b/libf2c/libI77/fmt.c
index a82f82153f6..8f08952ed45 100644
--- a/libf2c/libI77/fmt.c
+++ b/libf2c/libI77/fmt.c
@@ -18,7 +18,7 @@
/* special quote character for stu */
extern int f__cursor,f__scale;
extern flag f__cblank,f__cplus; /*blanks in I and compulsory plus*/
-struct syl f__syl[SYLMX];
+static struct syl f__syl[SYLMX];
int f__parenlvl,f__pc,f__revloc;
static
@@ -53,8 +53,8 @@ op_gen(int a, int b, int c, int d)
}
p->op=a;
p->p1=b;
- p->p2=c;
- p->p3=d;
+ p->p2.i[0]=c;
+ p->p2.i[1]=d;
return(f__pc++);
}
#ifdef KR_headers
@@ -103,7 +103,6 @@ char *f_s(char *s, int curloc)
{
return(NULL);
}
- skip(s);
return(s);
}
@@ -160,7 +159,7 @@ ne_d(char *s, char **p)
case 'H':
case 'h':
sp = &f__syl[op_gen(H,n,0,0)];
- *(char **)&sp->p2 = s + 1;
+ sp->p2.s = s + 1;
s+=n;
break;
}
@@ -169,7 +168,7 @@ ne_d(char *s, char **p)
case '"':
case '\'':
sp = &f__syl[op_gen(APOS,0,0,0)];
- *(char **)&sp->p2 = s;
+ sp->p2.s = s;
if((*p = ap_end(s)) == NULL)
return(0);
return(1);
@@ -365,11 +364,39 @@ pars_f(s) char *s;
pars_f(char *s)
#endif
{
+ char *e;
+
f__parenlvl=f__revloc=f__pc=0;
- if(f_s(s,0) == NULL)
+ if((e=f_s(s,0)) == NULL)
{
+ /* Try and delimit the format string. Parens within
+ hollerith and quoted strings have to match for this
+ to work, but it's probably adequate for most needs.
+ Note that this is needed because a valid CHARACTER
+ variable passed for FMT= can contain '(I)garbage',
+ where `garbage' is billions and billions of junk
+ characters, and it's up to the run-time library to
+ know where the format string ends by counting parens.
+ Meanwhile, still treat NUL byte as "hard stop", since
+ f2c still appends that at end of FORMAT-statement
+ strings. */
+
+ int level=0;
+
+ for (f__fmtlen=0;
+ ((*s!=')') || (--level > 0))
+ && (*s!='\0')
+ && (f__fmtlen<80);
+ ++s, ++f__fmtlen)
+ {
+ if (*s=='(')
+ ++level;
+ }
+ if (*s==')')
+ ++f__fmtlen;
return(-1);
}
+ f__fmtlen = e - s;
return(0);
}
#define STKSZ 10
@@ -421,8 +448,8 @@ integer do_fio(ftnint *number, char *ptr, ftnlen len)
loop: switch(type_f((p= &f__syl[f__pc])->op))
{
default:
- fprintf(stderr,"unknown code in do_fio: %d\n%s\n",
- p->op,f__fmtbuf);
+ fprintf(stderr,"unknown code in do_fio: %d\n%.*s\n",
+ p->op,f__fmtlen,f__fmtbuf);
err(f__elist->cierr,100,"do_fio");
case NED:
if((*f__doned)(p))
diff --git a/libf2c/libI77/fmt.h b/libf2c/libI77/fmt.h
index 509746e13b9..6197e76ed5a 100644
--- a/libf2c/libI77/fmt.h
+++ b/libf2c/libI77/fmt.h
@@ -1,6 +1,8 @@
struct syl
-{ int op,p1,p2,p3;
-};
+{ int op;
+ int p1;
+ union { int i[2]; char *s;} p2;
+ };
#define RET1 1
#define REVERT 2
#define GOTO 3
@@ -37,7 +39,6 @@ struct syl
#define OM 34
#define Z 35
#define ZM 36
-extern struct syl f__syl[];
extern int f__pc,f__parenlvl,f__revloc;
typedef union
{ real pf;
@@ -78,6 +79,7 @@ extern int wrt_L(Uint*, int, ftnlen);
#endif
extern flag f__cblank,f__cplus,f__workdone, f__nonl;
extern char *f__fmtbuf;
+extern int f__fmtlen;
extern int f__scale;
#define GET(x) if((x=(*f__getn)())<0) return(x)
#define VAL(x) (x!='\n'?x:' ')
diff --git a/libf2c/libI77/lread.c b/libf2c/libI77/lread.c
index 3f0642c24cd..4fb14eed29e 100644
--- a/libf2c/libI77/lread.c
+++ b/libf2c/libI77/lread.c
@@ -8,6 +8,7 @@
extern char *f__fmtbuf;
+extern int f__fmtlen;
#ifdef Allow_TYQUAD
static longint f__llx;
@@ -518,6 +519,7 @@ c_le(cilist *a)
if(f__init != 1) f_init();
f__init = 3;
f__fmtbuf="list io";
+ f__fmtlen=7;
if(a->ciunit>=MXUNIT || a->ciunit<0)
err(a->cierr,101,"stler");
f__scale=f__recpos=0;
diff --git a/libf2c/libI77/open.c b/libf2c/libI77/open.c
index b08302b5b2c..d7e8491df04 100644
--- a/libf2c/libI77/open.c
+++ b/libf2c/libI77/open.c
@@ -143,12 +143,20 @@ integer f_open(olist *a)
case 's':
case 'S':
b->uscrtch=1;
+#ifdef HAVE_TEMPNAM /* Allow use of TMPDIR preferentially. */
+ s = tempnam (0, buf);
+ if (strlen (s) >= sizeof (buf))
+ err (a->oerr, 132, "open");
+ (void) strcpy (buf, s);
+ free (s);
+#else /* ! defined (HAVE_TEMPNAM) */
#ifdef _POSIX_SOURCE
tmpnam(buf);
#else
(void) strcpy(buf,"tmp.FXXXXXX");
(void) mktemp(buf);
#endif
+#endif /* ! defined (HAVE_TEMPNAM) */
goto replace;
case 'n':
case 'N':
diff --git a/libf2c/libI77/rdfmt.c b/libf2c/libI77/rdfmt.c
index 0d8c2b4d9ca..b03bcc5dbf6 100644
--- a/libf2c/libI77/rdfmt.c
+++ b/libf2c/libI77/rdfmt.c
@@ -433,7 +433,7 @@ rd_ed(struct syl *p, char *ptr, ftnlen len)
case D:
case G:
case GE:
- case F: ch = rd_F((ufloat *)ptr,p->p1,p->p2,len);
+ case F: ch = rd_F((ufloat *)ptr,p->p1,p->p2.i[0],len);
break;
/* Z and ZM assume 8-bit bytes. */
@@ -460,8 +460,8 @@ rd_ned(struct syl *p)
default: fprintf(stderr,"rd_ned, unexpected code: %d\n", p->op);
sig_die(f__fmtbuf, 1);
case APOS:
- return(rd_POS(*(char **)&p->p2));
- case H: return(rd_H(p->p1,*(char **)&p->p2));
+ return(rd_POS(p->p2.s));
+ case H: return(rd_H(p->p1,p->p2.s));
case SLASH: return((*f__donewrec)());
case TR:
case X: f__cursor += p->p1;
diff --git a/libf2c/libI77/wrtfmt.c b/libf2c/libI77/wrtfmt.c
index e14efa85833..4350fc984f6 100644
--- a/libf2c/libI77/wrtfmt.c
+++ b/libf2c/libI77/wrtfmt.c
@@ -326,7 +326,7 @@ w_ed(struct syl *p, char *ptr, ftnlen len)
sig_die(f__fmtbuf, 1);
case I: return(wrt_I((Uint *)ptr,p->p1,len, 10));
case IM:
- return(wrt_IM((Uint *)ptr,p->p1,p->p2,len,10));
+ return(wrt_IM((Uint *)ptr,p->p1,p->p2.i[0],len,10));
/* O and OM don't work right for character, double, complex, */
/* or doublecomplex, and they differ from Fortran 90 in */
@@ -334,7 +334,7 @@ w_ed(struct syl *p, char *ptr, ftnlen len)
case O: return(wrt_I((Uint *)ptr, p->p1, len, 8));
case OM:
- return(wrt_IM((Uint *)ptr,p->p1,p->p2,len,8));
+ return(wrt_IM((Uint *)ptr,p->p1,p->p2.i[0],len,8));
case L: return(wrt_L((Uint *)ptr,p->p1, len));
case A: return(wrt_A(ptr,len));
case AW:
@@ -342,17 +342,17 @@ w_ed(struct syl *p, char *ptr, ftnlen len)
case D:
case E:
case EE:
- return(wrt_E((ufloat *)ptr,p->p1,p->p2,p->p3,len));
+ return(wrt_E((ufloat *)ptr,p->p1,p->p2.i[0],p->p2.i[1],len));
case G:
case GE:
- return(wrt_G((ufloat *)ptr,p->p1,p->p2,p->p3,len));
- case F: return(wrt_F((ufloat *)ptr,p->p1,p->p2,len));
+ return(wrt_G((ufloat *)ptr,p->p1,p->p2.i[0],p->p2.i[1],len));
+ case F: return(wrt_F((ufloat *)ptr,p->p1,p->p2.i[0],len));
/* Z and ZM assume 8-bit bytes. */
case Z: return(wrt_Z((Uint *)ptr,p->p1,0,len));
case ZM:
- return(wrt_Z((Uint *)ptr,p->p1,p->p2,len));
+ return(wrt_Z((Uint *)ptr,p->p1,p->p2.i[0],len));
}
}
#ifdef KR_headers
@@ -378,8 +378,8 @@ w_ned(struct syl *p)
f__cursor += p->p1;
return(1);
case APOS:
- return(wrt_AP(*(char **)&p->p2));
+ return(wrt_AP(p->p2.s));
case H:
- return(wrt_H(p->p1,*(char **)&p->p2));
+ return(wrt_H(p->p1,p->p2.s));
}
}
diff --git a/libf2c/libU77/Version.c b/libf2c/libU77/Version.c
index 88a2907c217..99c58c92313 100644
--- a/libf2c/libU77/Version.c
+++ b/libf2c/libU77/Version.c
@@ -1,6 +1,6 @@
-static char junk[] = "\n@(#) LIBU77 VERSION 19970609\n";
+static char junk[] = "\n@(#) LIBU77 VERSION 19970919\n";
-char __G77_LIBU77_VERSION__[] = "0.5.21";
+char __G77_LIBU77_VERSION__[] = "0.5.22";
#include <stdio.h>
diff --git a/libf2c/libU77/chmod_.c b/libf2c/libU77/chmod_.c
index 9797b80f3f5..d482d9ed828 100644
--- a/libf2c/libU77/chmod_.c
+++ b/libf2c/libU77/chmod_.c
@@ -29,7 +29,10 @@ Boston, MA 02111-1307, USA. */
#if HAVE_STDLIB_H
# include <stdlib.h>
#else
-# include <stdio.h> /* for NULL */
+# include <stdio.h>
+#endif
+#if STDC_HEADERS
+# include <string.h>
#endif
#include "f2c.h"
@@ -62,7 +65,7 @@ integer G77_chmod_0 (/* const */ char *name, /* const */ char *mode, const ftnle
char chmod_path [] = CHMOD_PATH;
l = strlen (chmod_path);
buff = malloc (Lname+Lmode+l+3+13+1);
- if (buff == NULL) return -1;
+ if (!buff) return -1;
ii[0] = l; a[0] = chmod_path;
ii[1] = 1; a[1] = " ";
ii[2] = Lmode; a[2] = mode;
diff --git a/libf2c/libU77/dtime_.c b/libf2c/libU77/dtime_.c
index dc0accbfdf0..9569db3fae0 100644
--- a/libf2c/libU77/dtime_.c
+++ b/libf2c/libU77/dtime_.c
@@ -43,21 +43,23 @@ double G77_dtime_0 (tarray)
double G77_dtime_0 (real tarray[2])
#endif
{
- time_t utime, stime;
- static time_t old_utime = 0, old_stime = 0;
/* The getrusage version is only the default for convenience. */
#ifdef HAVE_GETRUSAGE
+ float utime, stime;
+ static float old_utime = 0.0, old_stime = 0.0;
struct rusage rbuff;
if (getrusage (RUSAGE_SELF, &rbuff) != 0)
abort ();
- utime = ((float) (rbuff.ru_utime).tv_sec +
- (float) (rbuff.ru_utime).tv_usec/1000000.0);
+ utime = (float) (rbuff.ru_utime).tv_sec +
+ (float) (rbuff.ru_utime).tv_usec/1000000.0;
tarray[0] = utime - (float) old_utime;
- stime = ((float) (rbuff.ru_stime).tv_sec +
- (float) (rbuff.ru_stime).tv_usec/1000000.0);
+ stime = (float) (rbuff.ru_stime).tv_sec +
+ (float) (rbuff.ru_stime).tv_usec/1000000.0;
tarray[1] = stime - old_stime;
#else /* HAVE_GETRUSAGE */
+ time_t utime, stime;
+ static time_t old_utime = 0, old_stime = 0;
struct tms buffer;
/* NeXTStep seems to define _SC_CLK_TCK but not to have sysconf;
diff --git a/libf2c/readme.netlib b/libf2c/readme.netlib
index 5d2ac98226f..e74898762e9 100644
--- a/libf2c/readme.netlib
+++ b/libf2c/readme.netlib
@@ -521,10 +521,19 @@ with F8X_NML_ELIDE_QUOTES #defined. wrtfmt.o: wrt_G: tweak to print
the right number of 0's for zero under G format.
Sat Aug 16 05:45:32 EDT 1997
- libI77: iio.c: fix bug in internal writes to an array of character
+ libi77: iio.c: fix bug in internal writes to an array of character
strings that sometimes caused one more array element than required by
the format to be blank-filled. Example: format(1x).
+Wed Sep 17 00:39:29 EDT 1997
+ libi77: fmt.[ch] rdfmt.c wrtfmt.c: tweak struct syl for machines
+with 64-bit pointers and 32-bit ints that did not 64-bit align
+struct syl (e.g., Linux on the DEC Alpha). This change should be
+invisible on other machines.
+
+Sun Sep 21 22:05:19 EDT 1997
+ libf77: [de]time_.c (Unix systems only): change return type to double.
+
Current timestamps of files in "all from f2c/src", sorted by time,
appear below (mm/dd/year hh:mm:ss). To bring your source up to date,
obtain source files with a timestamp later than the time shown in your