Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package f2c for openSUSE:Factory checked in at 2022-12-02 13:13:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/f2c (Old) and /work/SRC/openSUSE:Factory/.f2c.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "f2c" Fri Dec 2 13:13:40 2022 rev:20 rq:1039515 version:20210928 Changes: -------- --- /work/SRC/openSUSE:Factory/f2c/f2c.changes 2019-07-17 13:19:50.547655601 +0200 +++ /work/SRC/openSUSE:Factory/.f2c.new.1835/f2c.changes 2022-12-02 13:13:55.738113091 +0100 @@ -1,0 +2,12 @@ +Thu Jul 7 18:51:06 UTC 2022 - Matthias Eliasson <eli...@opensuse.org> + +- update to version 20210928 + * README: add a paragraph about the size of integers and a simple + change to f2c.h that is appropriate when sizeof(int) == 4 and + sizeof(long) == 8. + * xsum.c: trivial change to banish a pedantic compiler warning. +- change versioning to date as all other major distros are doing +- add f77 script (fc) +- run spec-cleaner + +------------------------------------------------------------------- New: ---- fc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ f2c.spec ++++++ --- /var/tmp/diff_new_pack.8pAEyu/_old 2022-12-02 13:13:56.354116479 +0100 +++ /var/tmp/diff_new_pack.8pAEyu/_new 2022-12-02 13:13:56.362116522 +0100 @@ -1,7 +1,7 @@ # # spec file for package f2c # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,21 +20,22 @@ %global sover 0.23 Name: f2c # -Version: 0.23 +Version: 20210928 Release: 0 Summary: A Fortran-77 to C Translator License: MIT Group: Development/Languages/Fortran -Source0: http://www.netlib.org/f2c/src.tgz -Source1: http://www.netlib.org/f2c/libf2c.zip -Source2: http://www.netlib.org/f2c/f2c.pdf -Source3: http://www.netlib.org/f2c/f2c.ps +URL: https://www.netlib.org/f2c/ +Source0: https://www.netlib.org/f2c/src.tgz +Source1: https://www.netlib.org/f2c/libf2c.zip +Source2: https://www.netlib.org/f2c/f2c.pdf +Source3: https://www.netlib.org/f2c/f2c.ps +Source4: https://www.netlib.org/f2c/fc Patch0: f2c-20110801.patch Patch1: libf2c-20110801-format-security.patch Patch2: f2c-20180821.patch BuildRequires: tcsh BuildRequires: unzip -URL: http://www.netlib.org/f2c/ %description This package uses an 'f77' script that hides the C translation process from the user. @@ -68,11 +69,11 @@ sed -i "s/@SOVER@/%{sover}/" libf2c/makefile.u # PDF and PS documentation -cp %{SOURCE2} %{SOURCE3} . +cp %{SOURCE2} %{SOURCE3} %{SOURCE4} . %build -make -C src -f makefile.u %{?_smp_mflags} CFLAGS="%{optflags} -fno-strict-aliasing" f2c -make -C libf2c -f makefile.u %{?_smp_mflags} CFLAGS="%{optflags} -fPIC -fno-strict-aliasing" +%make_build -C src -f makefile.u CFLAGS="%{optflags} -fno-strict-aliasing" f2c +%make_build -C libf2c -f makefile.u CFLAGS="%{optflags} -fPIC -fno-strict-aliasing" %install install -D -p -m 644 src/f2c.h %{buildroot}%{_includedir}/f2c.h @@ -82,6 +83,10 @@ ln -sr %{buildroot}%{_libdir}/libf2c.so.%{sover} %{buildroot}%{_libdir}/libf2c.so.0 ln -sr %{buildroot}%{_libdir}/libf2c.so.%{sover} %{buildroot}%{_libdir}/libf2c.so +# Setup f77 script +sed -i "s/@lib@/%{_lib}/" fc +install -Dpm 0755 fc %{buildroot}%{_bindir}/f77 + %files -n %{libname} %{_libdir}/*.so.* @@ -94,6 +99,7 @@ %files %{_bindir}/f2c +%{_bindir}/f77 %{_mandir}/man1/f2c.1%{?ext_man} %changelog ++++++ fc ++++++ #! /bin/sh # NOTE: you may need to adjust the references to /usr/local/... below # (or remove them if they're not needed on your system). # You may need to add something like "-Olimit 2000" to the -O # processing below or change it to something more suitable for your # system. See also the comments starting with ### below. # Note that with some shells, invocations of the form # CFLAGS='system-specific stuff' fc ... # may be useful as way to pass system-specific stuff to the C compiler. # The script below simply appends to the initial CFLAGS value. PATH=/usr/local/bin:/bin:/usr/bin # f77-style shell script to compile and load fortran, C, and assembly codes # usage: f77 [options] files [-l library] # Options: # -o objfile Override default executable name a.out. # -a use automatic variable storage (on the stack) # by default -- rather than static storage # -c Do not call linker, leave relocatables in *.o. # -C Check that subscripts are in bounds. # -S leave assembler output on file.s # -L libdir (passed to ld) # -l library (passed to ld) # -u complain about undeclared variables # -w omit all warning messages # -w66 omit Fortran 66 compatibility warning messages # files FORTRAN source files ending in .f . # FORTRAN with cpp preprocessor directives # ending in .F . # C source files ending in .c . # Assembly language files ending in .s . # efl source files ending in .e . # RATFOR files ending in .r . # Object files ending in .o . # Shared libraries ending in .so . # f2c prototype files ending in .P ; such # files only affect subsequent files. # -D def passed to C compiler (for .c files) # or to cpp (for .F files) # -I includepath passed to C compiler (for .c files) # or to cpp (for .F files), and to f2c # -m xxx passed to C compiler as -mxxx # -N tnnn allow nnn entries in table t # -P emit .P files # -r8 promote real to double precision and # complex to double complex # -s strip executable # -trapuv Initialize floating-point variables to # signaling NaNs (on machines with IEEE # arithmetic) unless they appear in save, # common, or data statements. Initialize # other kinds of variables to values that # may attract attention if used without # being assigned proper values. # -U def passed to C compiler (for .c files) # or to cpp (for .F files) to remove def # -v show current f2c version # --version same as -v s=/tmp/stderr_$$ t=/tmp/f77_$$.o ### On some systems (e.g., IRIX), -common prevents complaints ### about multiple definitions of COMMON blocks. #CC=${CC_f2c:-'cc -common'} CC=${CC_f2c:-'cc'} EFL=${EFL:-efl} EFLFLAGS=${EFLFLAGS:-'system=portable deltastno=10'} RATFOR=${RATFOR:-ratfor} RFLAGS=${RFLAGS:-'-6&'} F2C=${F2C:-/usr/local/bin/f2c} show_fc_help=0 case $1 in --help) show_fc_help=1;; --version) show_fc_help=2;; '-?') show_fc_help=1;; -h) show_fc_help=1;; -v) show_fc_help=2;; esac case $show_fc_help in 1) echo 'f77 script based on f2c' echo 'For usage details, see comments at the beginning of' $0 . echo 'For pointers to f2c documentation, invoke' $F2C --help exit 0;; 2) echo $0 'script based on f2c:'; $F2C -v exit 0;; esac F2CFLAGS=${F2CFLAGS:='-ARw8 -Nn802 -Nq300 -Nx400'} CPP=${CPP:-/lib/cpp} rc=0 trap "rm -f $s $t; exit \$rc" 0 OUTF=a.out OUTO= cOPT=1 set -- `getopt acCD:gI:L:m:N:O:U:o:r:sSt:uw6 "$@"` case $? in 0);; *) rc=$?; exit;; esac CPPFLAGS=${CPPFLAGS:-'-I/usr/local/include'} CFLAGSF2C=${CFLAGSF2C:-'-I/usr/local/include'} OFILES= trapuv= strip= LIBS="-lf2c -lm" while test X"$1" != X-- do case "$1" in -a) F2CFLAGS="$F2CFLAGS -a" shift;; -C) F2CFLAGS="$F2CFLAGS -C" shift;; -c) cOPT=0 shift ;; -D) CPPFLAGS="$CPPFLAGS -D$2" shift 2 ;; -g) CFLAGS="$CFLAGS -g" F2CFLAGS="$F2CFLAGS -g" shift;; -I) CPPFLAGS="$CPPFLAGS -I$2" F2CFLAGS="$F2CFLAGS -I$2" shift 2 ;; -m) CC="$CC -m$2" shift 2 ;; -U) CPPFLAGS="$CPPFLAGS -U$2" shift 2 ;; -o) OUTF=$2 OUTO=$2 shift 2 ;; -O) case $2 in 1) O=-O1;; 2) O=-O2;; 3) O=-O3;; *) O=-O;; esac case $O in -O);; *) shift;; esac CFLAGS="$CFLAGS $O" # CFLAGS="$CFLAGS $O -Olimit 2000" shift ;; -r) case $2 in 8) F2CFLAGS="$F2CFLAGS -r8";; *) echo "Ignoring -r$2";; esac shift; shift ;; -s) strip=1 shift ;; -u) F2CFLAGS="$F2CFLAGS -u" shift ;; -w) F2CFLAGS="$F2CFLAGS -w" case $2 in -6) F2CFLAGS="$F2CFLAGS"66; shift case $2 in -6) shift;; esac;; esac shift ;; -L) OFILES="$OFILES $1$2" shift 2 case $cOPT in 1) cOPT=2;; esac ;; -L*) OFILES="$OFILES $1" shift case $cOPT in 1) cOPT=2;; esac ;; -N) F2CFLAGS="$F2CFLAGS $1""$2" shift 2 ;; -P) F2CFLAGS="$F2CFLAGS $1" shift ;; -S) CFLAGS="$CFLAGS -S" cOPT=0 shift ;; -t) case $2 in rapuv) F2CFLAGS="$F2CFLAGS -trapuv" trapuv=1 # LIBS="$LIBS -lfpe" shift 2;; *) echo "invalid parameter $1" 1>&2 shift;; esac ;; '') echo $0: 'unexpected null argument'; exit 1;; *) echo "invalid parameter $1" 1>&2 shift ;; esac done shift case $cOPT in 0) case $OUTO in '');; *) CFLAGS="$CFLAGS -o $OUTO";; esac;; esac while test -n "$1" do case "$1" in *.[fF]) case "$1" in *.f) f=".f";; *.F) f=".F";; esac case "$1" in *.f) b=`basename $1 .f` $F2C $F2CFLAGS $1 rc=$? ;; *.F) b=`basename $1 .F` $CPP $CPPFLAGS $1 >$b.i rc=$? case $rc in 0) $F2C $F2CFLAGS <$b.i >$b.c rc=$? ;;esac rm $b.i ;; esac case $rc in 0);; *) exit;; esac $CC -c $CFLAGSF2C $CFLAGS $b.c 2>$s rc=$? sed '/parameter .* is not referenced/d;/warning: too many parameters/d' $s 1>&2 case $rc in 0);; *) exit;; esac OFILES="$OFILES $b.o" rm $b.c case $cOPT in 1) cOPT=2;; esac shift ;; *.e) b=`basename $1 .e` $EFL $EFLFLAGS $1 >$b.f case $? in 0);; *) rc=$?; exit;; esac $F2C $F2CFLAGS $b.f case $? in 0);; *) rc=$?; exit;; esac $CC -c $CFLAGSF2C $CFLAGS $b.c case $? in 0);; *) rc=$?; exit;; esac OFILES="$OFILES $b.o" rm $b.[cf] case $cOPT in 1) cOPT=2;; esac shift ;; *.r) b=`basename $1 .r` $RATFOR $RFLAGS $1 >$b.f case $? in 0);; *) rc=$?; exit;; esac $F2C $F2CFLAGS $b.f case $? in 0);; *) rc=$?; exit;; esac $CC -c $CFLAGSF2C $CFLAGS $b.c case $? in 0);; *) rc=$?; exit;; esac OFILES="$OFILES $b.o" rm $b.[cf] case $cOPT in 1) cOPT=2;; esac shift ;; *.s) echo $1: 1>&2 OFILE=`basename $1 .s`.o ${AS:-as} -o $OFILE $AFLAGS $1 case $? in 0);; *) rc=$?; exit;; esac OFILES="$OFILES $OFILE" case $cOPT in 1) cOPT=2;; esac shift ;; *.c) echo $1: 1>&2 OFILE=`basename $1 .c`.o $CC -c $CFLAGSF2C $CPPFLAGS $CFLAGS $1 rc=$?; case $rc in 0);; *) rc=$?; exit;; esac OFILES="$OFILES $OFILE" case $cOPT in 1) cOPT=2;; esac shift ;; *.o) OFILES="$OFILES $1" case $cOPT in 1) cOPT=2;; esac shift ;; *.so) OFILES="$OFILES $1" case $cOPT in 1) cOPT=2;; esac shift ;; -[lL]) OFILES="$OFILES $1$2" shift 2 case $cOPT in 1) cOPT=2;; esac ;; -[lL]*) OFILES="$OFILES $1" shift case $cOPT in 1) cOPT=2;; esac ;; -o) case $cOPT in 0) CFLAGS="$CFLAGS -o $2";; *) OUTF=$2;; esac shift 2;; *.P) F2CFLAGS="$F2CFLAGS $1" shift ;; *) OFILES="$OFILES $1" shift case $cOPT in 1) cOPT=2;; esac ;; esac done ### On some (IRIX) systems, -Wl,-dont_warn_unused prevents complaints ### about unnecessary -l options. case $cOPT in 2) # case $trapuv in 1) OFILES="$OFILES -lfpe";; esac # $CC -Wl,-dont_warn_unused -o $OUTF -u MAIN__ -L/usr/local/lib $OFILES $LIBS $CC -o $OUTF -u MAIN__ -L/usr/local/lib $OFILES $LIBS case $strip in 1) strip $OUTF;; esac ;; esac rc=$? exit $rc ++++++ src.tgz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/changes new/src/changes --- old/src/changes 2019-03-11 21:47:07.000000000 +0100 +++ new/src/changes 2020-09-16 23:56:11.000000000 +0200 @@ -3502,3 +3502,22 @@ 20190311 main.c: update URL's in "f2c -?" and "f2c --help" output. + +20191129 + pread.c: fix a glitch not known to have caused any trouble: +355c355 +< if (c < '0' && c > '9') +--- +> if (c < '0' || c > '9') + +20200425 + sysdeptest.c: add #include <stdlib.h> + +20200916 + data.c exec.c format.c formatdata.c ftypes.h mem.c output.c +p1output.c proc.c sysdep.c: introduce type Addr, an unsigned +integer type that can hold an address. The changes allow compilation +of the f2c source on platforms that actually use more than 32 bits +for addresses. (Many 64-bit platforms keep addresses <= 32 bits +long when possible. One that does not and for which today's changes +are relevant is Microsoft Windows with Microsoft's cl compiler.) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/data.c new/src/data.c --- old/src/data.c 2010-07-07 18:39:20.000000000 +0200 +++ new/src/data.c 2020-09-10 21:17:06.000000000 +0200 @@ -116,8 +116,7 @@ ip = &(p->impldoblock); if(ip->implb==NULL || ip->impub==NULL || ip->varnp==NULL) { char buf[100]; - sprintf(buf, "bad impldoblock #%lx", - (unsigned long)ip); + sprintf(buf, "bad impldoblock #" Addrfmt, (Addr)ip); Fatal(buf); } if(ip->isactive) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/exec.c new/src/exec.c --- old/src/exec.c 2000-07-06 17:32:44.000000000 +0200 +++ new/src/exec.c 2020-09-10 21:03:38.000000000 +0200 @@ -612,6 +612,7 @@ /* Declare the loop increment value, casting it to the type of the index variable */ + incsign = 0; if( ISCONST(DOINCR) ) { ctlstack->dostep = mkconv(dotype, DOINCR); @@ -817,10 +818,10 @@ cpprev = 0; for(k = 0, cp = vname->varxptr.assigned_values; cp; cpprev = cp, cp = cp->nextp, k++) - if ((ftnint)cp->datap == stno) + if ((ftnint)(Addr)cp->datap == stno) break; if (!cp) { - cp = mkchain((char *)stno, CHNULL); + cp = mkchain((char *)(Addr)stno, CHNULL); if (cpprev) cpprev->nextp = cp; else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/format.c new/src/format.c --- old/src/format.c 2010-08-27 17:01:19.000000000 +0200 +++ new/src/format.c 2020-09-16 21:31:01.000000000 +0200 @@ -71,6 +71,7 @@ static void do_p1_subr_ret Argdcl((FILEP, FILEP)); static int get_p1_token Argdcl((FILEP)); static int p1get_const Argdcl((FILEP, int, Constp*)); +static int p1geta Argdcl((FILEP, Addr*)); static int p1getd Argdcl((FILEP, long int*)); static int p1getf Argdcl((FILEP, char**)); static int p1getn Argdcl((FILEP, int, char**)); @@ -381,13 +382,13 @@ Namep namep = (Namep) NULL; int status; - status = p1getd (infile, (long *) &namep); + status = p1geta (infile, (Addr *) &namep); if (status == EOF) err ("do_p1_name_pointer: Missing pointer at end of file\n"); else if (status == 0 || namep == (Namep) NULL) - erri ("do_p1_name_pointer: Illegal name pointer in p1 file: '#%lx'\n", - (unsigned long) namep); + erri ("do_p1_name_pointer: Illegal name pointer in p1 file: '#" Addrfmt "'\n", + (Addr) namep); return (expptr) namep; } /* do_p1_name_pointer */ @@ -2328,7 +2329,7 @@ #endif { int status; - unsigned long a; + Addr a; struct Constblock *result; if (type != TYCHAR) { @@ -2364,7 +2365,7 @@ result->vstg = 1; break; case TYCHAR: - status = fscanf(infile, "%lx", &a); + status = fscanf(infile, Addrfmt, &a); *resultp = (struct Constblock *) a; break; default: @@ -2378,6 +2379,18 @@ static int #ifdef KR_headers +p1geta(infile, result) + FILE *infile; + Addr *result; +#else +p1geta(FILE *infile, Addr *result) +#endif +{ + return fscanf (infile, Addrfmt, result); +} /* p1getd */ + + static int +#ifdef KR_headers p1getd(infile, result) FILE *infile; long *result; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/formatdata.c new/src/formatdata.c --- old/src/formatdata.c 2001-03-01 22:16:12.000000000 +0100 +++ new/src/formatdata.c 2020-09-11 18:45:45.000000000 +0200 @@ -332,13 +332,13 @@ if (type == TYCHAR) { for(last = 0; values; values = values->nextp) { cp = (chainp)values->datap; - loc = (ftnint)cp->datap; + loc = (ftnint)(Addr)cp->datap; if (loc > last) { write_char_init(outfile, Values, namep); goto done; } - last = (Ulong)cp->nextp->datap == TYBLANK - ? loc + (Ulong)cp->nextp->nextp->datap + last = (Addr)cp->nextp->datap == TYBLANK + ? loc + (Addr)cp->nextp->nextp->datap : loc + 1; } if (halign && info.name->tag == TNAME) { @@ -362,11 +362,11 @@ size = typesize[type]; loc = 0; for(; values; values = values->nextp) { - if ((Ulong)((chainp)values->datap)->nextp->datap == TYCHAR) { + if ((Addr)((chainp)values->datap)->nextp->datap == TYCHAR) { write_char_init(outfile, Values, namep); goto done; } - last = ((long) ((chainp) values->datap)->datap) / size; + last = (long) (((Addr)((chainp) values->datap)->datap) / size); if (last - loc > 4) { write_char_init(outfile, Values, namep); goto done; @@ -472,7 +472,7 @@ #endif newval = cpstring(pointer); else - newval = (char *)atol(pointer); + newval = (char *)Atol(pointer); if (vals) { prev_val->nextp = mkchain(newval, CHNULL); prev_val = prev_val -> nextp; @@ -482,7 +482,7 @@ pointer = end_ptr; } /* while *pointer */ - return mkchain((char *)offset, mkchain((char *)(Ulong)type, vals)); + return mkchain((char *)(Addr)offset, mkchain((char *)(Addr)type, (chainp)(Addr)vals)); } /* data_value */ static void @@ -580,7 +580,7 @@ while (values) { struct Constblock Const; - index = ((long) ((chainp) values->datap)->datap) / size; + index = (long)((Addr)(((chainp) values->datap)->datap) / size); while (index > main_index) { /* Fill with zeros. The structure shorthand works because the compiler @@ -616,9 +616,9 @@ nice_printf(outfile, "\" \""); k = 0; } - this_char = (int)(Ulong) ((chainp) values->datap)-> + this_char = (int)(Addr) ((chainp) values->datap)-> nextp->nextp->datap; - if ((Ulong)((chainp)values->datap)->nextp->datap == TYBLANK) { + if ((Addr)((chainp)values->datap)->nextp->datap == TYBLANK) { main_index += this_char; k += this_char; while(--this_char >= 0) @@ -695,19 +695,19 @@ for(k = 1, prev = CHNULL, v = values; v; prev = v, v = v->nextp) ; if (prev != CHNULL) - k = ((int)(Ulong) (((chainp) prev->datap)->datap)) + 2; + k = ((int)(Addr) (((chainp) prev->datap)->datap)) + 2; /* + 2 above for null char at end */ str = Alloc (k); for (str_ptr = str; values; str_ptr++) { - int index = (int)(Ulong) (((chainp) values->datap)->datap); + int index = (int)(Addr) (((chainp) values->datap)->datap); if (index < main_index) overlapping(); while (index > main_index++) *str_ptr++ = ' '; - k = (int)(Ulong)(((chainp)values->datap)->nextp->nextp->datap); - if ((Ulong)((chainp)values->datap)->nextp->datap == TYBLANK) { + k = (int)(Addr)(((chainp)values->datap)->nextp->nextp->datap); + if ((Addr)((chainp)values->datap)->nextp->datap == TYBLANK) { b = k; break; } @@ -847,12 +847,12 @@ nice_printf(outfile, "{"); cp = (chainp)v->datap; - loc = (ftnint)cp->datap; + loc = (ftnint)(Addr)cp->datap; comma = ""; for(v0 = v;;) { - switch((Ulong)cp->nextp->datap) { + switch((Addr)cp->nextp->datap) { case TYBLANK: - k = (ftnint)cp->nextp->nextp->datap; + k = (ftnint)(Addr)cp->nextp->nextp->datap; loc += k; while(--k >= 0) { nice_printf(outfile, "%s' '", comma); @@ -860,7 +860,7 @@ } break; case TYCHAR: - uk = (ftnint)cp->nextp->nextp->datap; + uk = (ftnint)(Addr)cp->nextp->nextp->datap; sprintf(buf, chr_fmt[uk], uk); nice_printf(outfile, "%s'%s'", comma, buf); comma = ", "; @@ -872,7 +872,7 @@ v0 = v; if (!(v = v->nextp) || !(cp = (chainp)v->datap)) break; - dloc = (ftnint)cp->datap; + dloc = (ftnint)(Addr)cp->datap; if (loc != dloc) break; } @@ -897,17 +897,17 @@ nice_printf(outfile, "\""); cp = (chainp)v->datap; - loc = (ftnint)cp->datap; + loc = (ftnint)(Addr)cp->datap; for(v0 = v;;) { - switch((Ulong)cp->nextp->datap) { + switch((Addr)cp->nextp->datap) { case TYBLANK: - k = (ftnint)cp->nextp->nextp->datap; + k = (ftnint)(Addr)cp->nextp->nextp->datap; loc += k; while(--k >= 0) nice_printf(outfile, " "); break; case TYCHAR: - k = (ftnint)cp->nextp->nextp->datap; + k = (ftnint)(Addr)cp->nextp->nextp->datap; nice_printf(outfile, str_fmt[k]); loc++; break; @@ -917,7 +917,7 @@ v0 = v; if (!(v = v->nextp) || !(cp = (chainp)v->datap)) break; - dloc = (ftnint)cp->datap; + dloc = (ftnint)(Addr)cp->datap; if (loc != dloc) break; } @@ -1071,8 +1071,8 @@ k = typesize[dtype]; if (j = (int)(L % k)) L += k - j; - v = mkchain((char *)L, - mkchain((char *)(Ulong)dtype, + v = mkchain((char *)(Addr)L, + mkchain((char *)(Addr)dtype, mkchain(z, CHNULL))); vlast = vlast->nextp = mkchain((char *)v, CHNULL); @@ -1080,9 +1080,9 @@ break; } cp = (chainp)v->datap; - if (basetype[(Ulong)cp->nextp->datap] == btype) + if (basetype[(Addr)cp->nextp->datap] == btype) break; - dloc = (ftnint)cp->datap; + dloc = (ftnint)(Addr)cp->datap; if (get_fill(dloc, loc, &t0, &t1, &L0, &L1, xtype)) { xfilled = 0; break; @@ -1094,20 +1094,20 @@ && btype <= type_choice[L1/szshort % 4] && btype <= type_choice[loc/szshort % 4]) break; - dtype = (int)(Ulong)cp->nextp->datap; + dtype = (int)(Addr)cp->nextp->datap; loc = dloc + (dtype == TYBLANK - ? (ftnint)cp->nextp->nextp->datap + ? (ftnint)(Addr)cp->nextp->nextp->datap : typesize[dtype]); } } - sentinel = mkchain((char *)L, mkchain((char *)TYERROR,CHNULL)); + sentinel = mkchain((char *)(Addr)L, mkchain((char *)(Addr)TYERROR,CHNULL)); vlast->nextp = mkchain((char *)sentinel, CHNULL); /* use doublereal fillers only if there are doublereal values */ k = TYLONG; for(v = values; v; v = v->nextp) - if (ONEOF((Ulong)((chainp)v->datap)->nextp->datap, + if (ONEOF((Addr)((chainp)v->datap)->nextp->datap, M(TYDREAL)|M(TYDCOMPLEX))) { k = TYDREAL; break; @@ -1120,18 +1120,18 @@ curtype = -1; for(v = values; v; v = v->nextp) { cp = (chainp)v->datap; - dloc = (ftnint)cp->datap; + dloc = (ftnint)(Addr)cp->datap; L = dloc - loc; if (L < 0) { overlapping(); - if ((Ulong)cp->nextp->datap != TYERROR) { + if ((Addr)cp->nextp->datap != TYERROR) { v1 = cp; frchain(&v1); v->datap = 0; } continue; } - dtype = (int)(Ulong)cp->nextp->datap; + dtype = (int)(Addr)cp->nextp->datap; if (dtype == TYBLANK) { dtype = TYCHAR; wasblank = 1; @@ -1165,7 +1165,7 @@ loc = dloc; } if (wasblank) { - loc += (ftnint)cp->nextp->nextp->datap; + loc += (ftnint)(Addr)cp->nextp->nextp->datap; dL = 1; } else { @@ -1182,10 +1182,10 @@ cp = (chainp)v->datap; if (!cp) continue; - dtype = (int)(Ulong)cp->nextp->datap; + dtype = (int)(Addr)cp->nextp->datap; if (dtype == TYERROR) break; - dloc = (ftnint)cp->datap; + dloc = (ftnint)(Addr)cp->datap; if (dloc > loc) { n = 1; if (!xfilled && (L2 = get_fill(dloc, loc, &t0, &t1, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/ftypes.h new/src/ftypes.h --- old/src/ftypes.h 2001-03-01 22:16:12.000000000 +0100 +++ new/src/ftypes.h 2020-09-11 18:39:43.000000000 +0200 @@ -26,6 +26,20 @@ #endif /*NO_LONG_LONG*/ #endif /*NO_TYQUAD*/ +#ifdef _WIN64 +#define USE_LONGLONG +#endif + +#ifdef USE_LONGLONG +typedef unsigned long long Addr; +#define Addrfmt "%llx" +#define Atol atoll +#else +typedef unsigned long Addr; +#define Addrfmt "%lx" +#define Atol atol +#endif + #define TYUNKNOWN 0 #define TYADDR 1 #define TYINT1 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/mem.c new/src/mem.c --- old/src/mem.c 2000-01-19 16:49:50.000000000 +0100 +++ new/src/mem.c 2020-09-16 20:03:03.000000000 +0200 @@ -44,15 +44,15 @@ char *rv; if (round) #ifdef CRAY - if ((long)next & 0xe000000000000000) - next = (char *)(((long)next & 0x1fffffffffffffff) + 1); + if ((Addr)next & 0xe000000000000000) + next = (char *)(((Addr)next & 0x1fffffffffffffff) + 1); #else #ifdef MSDOS if ((int)next & 1) next++; #else - next = (char *)(((long)next + sizeof(char *)-1) - & ~((long)sizeof(char *)-1)); + next = (char *)(((Addr)next + sizeof(char *)-1) + & ~((Addr)sizeof(char *)-1)); #endif #endif rv = next; @@ -102,15 +102,15 @@ if (round) #ifdef CRAY - if ((long)mem_next & 0xe000000000000000) - mem_next = (char *)(((long)mem_next & 0x1fffffffffffffff) + 1); + if ((Addr)mem_next & 0xe000000000000000) + mem_next = (char *)(((Addr)mem_next & 0x1fffffffffffffff) + 1); #else #ifdef MSDOS if ((int)mem_next & 1) mem_next++; #else - mem_next = (char *)(((long)mem_next + sizeof(char *)-1) - & ~((long)sizeof(char *)-1)); + mem_next = (char *)(((Addr)mem_next + sizeof(char *)-1) + & ~((Addr)sizeof(char *)-1)); #endif #endif rv = mem_next; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/mkfile.plan9 new/src/mkfile.plan9 --- old/src/mkfile.plan9 1970-01-01 01:00:00.000000000 +0100 +++ new/src/mkfile.plan9 2001-03-21 05:07:27.000000000 +0100 @@ -0,0 +1,107 @@ +# Plan 9 mkfile for f2c, a Fortran 77 to C converter + +</$objtype/mkfile +NPROC = 1 +CC = pcc +CFLAGS = -DANSI_Libraries -DNO_LONG_LONG + +%.$O: %.c + $CC -c $CFLAGS $stem.c + +OBJECTSd = main.$O init.$O gram.$O lex.$O proc.$O equiv.$O data.$O format.$O \ + expr.$O exec.$O intr.$O io.$O misc.$O error.$O mem.$O names.$O \ + output.$O p1output.$O pread.$O put.$O putpcc.$O vax.$O formatdata.$O \ + parse_args.$O niceprintf.$O cds.$O sysdep.$O version.$O + +MALLOC = malloc.$O +# To use the malloc whose source accompanies the f2c source, add malloc.$O +# to the right-hand side of the "MALLOC =" line above, so it becomes +# MALLOC = malloc.$O +# This gives faster execution on some systems, but some other systems do +# not tolerate replacement of the system's malloc. + +OBJECTS = $OBJECTSd $MALLOC + +all:N: xsum.out f2c + +f2c: $OBJECTS + $CC $LDFLAGS $OBJECTS -o f2c + +# The following used to be a rule for gram.c rather than gram1.c, but +# there are too many broken variants of yacc around, so now we +# distribute a correctly function gram.c (derived with a Unix variant +# of the yacc from plan9). + +gram1.c: gram.head gram.dcl gram.expr gram.exec gram.io defs.h tokdefs.h + ( sed <tokdefs.h "s/#define/%token/" ;\ + cat gram.head gram.dcl gram.expr gram.exec gram.io ) >gram.in + $YACC $YFLAGS gram.in + @echo "(There should be 4 shift/reduce conflicts.)" + sed 's/^# line.*/\/* & *\//' y.tab.c >gram.c + rm -f gram.in y.tab.c + +$OBJECTSd: defs.h ftypes.h defines.h machdefs.h sysdep.h + +tokdefs.h: tokens + grep -n . <tokens | sed 's/([^:]*):(.*)/#define \2 \1/' >tokdefs.h + +cds.$O: sysdep.h +exec.$O: p1defs.h names.h +expr.$O: output.h niceprintf.h names.h +format.$O: p1defs.h format.h output.h niceprintf.h names.h iob.h +formatdata.$O: format.h output.h niceprintf.h names.h +gram.$O: p1defs.h +init.$O: output.h niceprintf.h iob.h +intr.$O: names.h +io.$O: names.h iob.h +lex.$O : tokdefs.h p1defs.h +main.$O: parse.h usignal.h +mem.$O: iob.h +names.$O: iob.h names.h output.h niceprintf.h +niceprintf.$O: defs.h names.h output.h niceprintf.h +output.$O: output.h niceprintf.h names.h +p1output.$O: p1defs.h output.h niceprintf.h names.h +parse_args.$O: parse.h +proc.$O: tokdefs.h names.h niceprintf.h output.h p1defs.h +put.$O: names.h pccdefs.h p1defs.h +putpcc.$O: names.h +vax.$O: defs.h output.h pccdefs.h +output.h: niceprintf.h + +put.$O putpcc.$O: pccdefs.h + +f2c.t: f2c.1t + troff -man f2c.1t >f2c.t + +#f2c.1: f2c.1t +# nroff -man f2c.1t | col -b | uniq >f2c.1 + +clean: + rm -f *.$O f2c tokdefs.h f2c.t + +veryclean: clean + rm -f xsum + +b = Notice README cds.c data.c defines.h defs.h equiv.c error.c \ + exec.c expr.c f2c.1 f2c.1t f2c.h format.c format.h formatdata.c \ + ftypes.h gram.c gram.dcl gram.exec gram.expr gram.head gram.io \ + init.c intr.c io.c iob.h lex.c machdefs.h main.c \ + malloc.c mem.c memset.c misc.c names.c names.h niceprintf.c \ + niceprintf.h output.c output.h p1defs.h p1output.c \ + parse.h parse_args.c pccdefs.h pread.c proc.c put.c putpcc.c \ + sysdep.c sysdep.h tokens usignal.h vax.c version.c xsum.c + +xsum: xsum.c + $CC $CFLAGS -o xsum xsum.c + +#Check validity of transmitted source... +xsum.out: xsum $b + ./xsum $b >xsum1.out + cmp xsum0.out xsum1.out && mv xsum1.out xsum.out + +#On non-Unix systems that end lines with carriage-return/newline pairs, +#use "make xsumr.out" rather than "make xsum.out". The -r flag ignores +#carriage-return characters. +xsumr.out: xsum $b + ./xsum -r $b >xsum1.out + cmp xsum0.out xsum1.out && mv xsum1.out xsumr.out diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/output.c new/src/output.c --- old/src/output.c 2003-03-06 19:03:19.000000000 +0100 +++ new/src/output.c 2020-09-16 21:29:57.000000000 +0200 @@ -1571,7 +1571,7 @@ for(k = 0, value = namep -> varxptr.assigned_values; value; value = value->nextp, k++) { nice_printf (outfile, "case %d: goto %s;\n", k, - user_label((long)value->datap)); + user_label((Addr)value->datap)); } /* for value */ prev_tab (outfile); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/p1output.c new/src/p1output.c --- old/src/p1output.c 2010-07-07 18:43:42.000000000 +0200 +++ new/src/p1output.c 2020-09-16 21:28:44.000000000 +0200 @@ -35,6 +35,7 @@ static void p1_literal Argdcl((long int)); static void p1_name Argdcl((Namep)); static void p1_unary Argdcl((Exprp)); +static void p1puta Argdcl((int, Addr)); static void p1putd Argdcl((int, long int)); static void p1putdd Argdcl((int, int, int)); static void p1putddd Argdcl((int, int, int, int)); @@ -90,7 +91,7 @@ p1_name(Namep namep) #endif { - p1putd (P1_NAME_POINTER, (long) namep); + p1puta (P1_NAME_POINTER, (Addr) namep); namep->visused = 1; } /* p1_name */ @@ -206,8 +207,8 @@ if (vleng && !ISICON (vleng)) err("p1_const: bad vleng\n"); else - fprintf(pass1_file, "%d: %d %lx\n", P1_CONST, type, - (unsigned long)cpexpr((expptr)cp)); + fprintf(pass1_file, "%d: %d " Addrfmt "\n", P1_CONST, type, + (Addr)cpexpr((expptr)cp)); break; default: erri ("p1_const: bad constant type '%d'", type); @@ -351,7 +352,7 @@ #endif { if (parstate < INDATA) - earlylabs = mkchain((char *)lab, earlylabs); + earlylabs = mkchain((char *)(Addr)lab, earlylabs); else p1putd (P1_LABEL, lab); } @@ -491,7 +492,6 @@ { if (e == (struct Exprblock *) NULL) return; - p1putdd (P1_EXPR, e -> opcode, e -> vtype); p1_expr (e -> vleng); p1_expr (e -> leftp); @@ -610,6 +610,21 @@ } /* p1puts */ +/* p1puta -- Put an Addr into the Pass 1 intermediate file. */ + + static void +#ifdef KR_headers +p1puta(type, value) + int type; + Addr value; +#else +p1puta(int type, Addr value) +#endif +{ + fprintf (pass1_file, "%d: " Addrfmt "\n", type, value); +} /* p1_puta */ + + /* p1putd -- Put a typed integer into the Pass 1 intermediate file. */ static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/pread.c new/src/pread.c --- old/src/pread.c 2000-07-05 01:28:53.000000000 +0200 +++ new/src/pread.c 2019-11-30 00:26:39.000000000 +0100 @@ -352,7 +352,7 @@ return 1; if (c == ' ') break; - if (c < '0' && c > '9') + if (c < '0' || c > '9') goto ret0; L = 10*L + c - '0'; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/proc.c new/src/proc.c --- old/src/proc.c 2018-10-26 23:57:00.000000000 +0200 +++ new/src/proc.c 2020-09-16 20:09:38.000000000 +0200 @@ -415,7 +415,7 @@ freetemps(); if (earlylabs) { for(cp = earlylabs = revchain(earlylabs); cp; cp = cp->nextp) - p1_label((long)cp->datap); + p1_label((Addr)cp->datap); frchain(&earlylabs); } p1_line_number(lineno); /* for files that start with a MAIN program */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/sysdep.c new/src/sysdep.c --- old/src/sysdep.c 2009-04-12 01:56:11.000000000 +0200 +++ new/src/sysdep.c 2020-09-16 17:49:47.000000000 +0200 @@ -102,6 +102,11 @@ } } +#ifndef MSDOS +#include "sysdep.hd" +#include <unistd.h> /* for mkdtemp and rmdir */ +#endif + #ifndef NO_TEMPDIR static void rmtdir(Void) @@ -114,13 +119,6 @@ } #endif /*NO_TEMPDIR*/ -#ifndef MSDOS -#include "sysdep.hd" -#ifndef NO_MKDTEMP -#include <unistd.h> /* for mkdtemp */ -#endif -#endif - static void alloc_names(Void) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/sysdeptest.c new/src/sysdeptest.c --- old/src/sysdeptest.c 2009-04-12 01:40:31.000000000 +0200 +++ new/src/sysdeptest.c 2020-04-25 23:51:32.000000000 +0200 @@ -2,6 +2,7 @@ /* presence of mkdtemp and mkstemp by whether this links without error. */ #include <stdio.h> +#include <stdlib.h> #include <unistd.h> int diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/tokdefs.h new/src/tokdefs.h --- old/src/tokdefs.h 1970-01-01 01:00:00.000000000 +0100 +++ new/src/tokdefs.h 1994-01-19 00:12:58.000000000 +0100 @@ -0,0 +1,100 @@ +#define SEOS 1 +#define SCOMMENT 2 +#define SLABEL 3 +#define SUNKNOWN 4 +#define SHOLLERITH 5 +#define SICON 6 +#define SRCON 7 +#define SDCON 8 +#define SBITCON 9 +#define SOCTCON 10 +#define SHEXCON 11 +#define STRUE 12 +#define SFALSE 13 +#define SNAME 14 +#define SNAMEEQ 15 +#define SFIELD 16 +#define SSCALE 17 +#define SINCLUDE 18 +#define SLET 19 +#define SASSIGN 20 +#define SAUTOMATIC 21 +#define SBACKSPACE 22 +#define SBLOCK 23 +#define SCALL 24 +#define SCHARACTER 25 +#define SCLOSE 26 +#define SCOMMON 27 +#define SCOMPLEX 28 +#define SCONTINUE 29 +#define SDATA 30 +#define SDCOMPLEX 31 +#define SDIMENSION 32 +#define SDO 33 +#define SDOUBLE 34 +#define SELSE 35 +#define SELSEIF 36 +#define SEND 37 +#define SENDFILE 38 +#define SENDIF 39 +#define SENTRY 40 +#define SEQUIV 41 +#define SEXTERNAL 42 +#define SFORMAT 43 +#define SFUNCTION 44 +#define SGOTO 45 +#define SASGOTO 46 +#define SCOMPGOTO 47 +#define SARITHIF 48 +#define SLOGIF 49 +#define SIMPLICIT 50 +#define SINQUIRE 51 +#define SINTEGER 52 +#define SINTRINSIC 53 +#define SLOGICAL 54 +#define SNAMELIST 55 +#define SOPEN 56 +#define SPARAM 57 +#define SPAUSE 58 +#define SPRINT 59 +#define SPROGRAM 60 +#define SPUNCH 61 +#define SREAD 62 +#define SREAL 63 +#define SRETURN 64 +#define SREWIND 65 +#define SSAVE 66 +#define SSTATIC 67 +#define SSTOP 68 +#define SSUBROUTINE 69 +#define STHEN 70 +#define STO 71 +#define SUNDEFINED 72 +#define SWRITE 73 +#define SLPAR 74 +#define SRPAR 75 +#define SEQUALS 76 +#define SCOLON 77 +#define SCOMMA 78 +#define SCURRENCY 79 +#define SPLUS 80 +#define SMINUS 81 +#define SSTAR 82 +#define SSLASH 83 +#define SPOWER 84 +#define SCONCAT 85 +#define SAND 86 +#define SOR 87 +#define SNEQV 88 +#define SEQV 89 +#define SNOT 90 +#define SEQ 91 +#define SLT 92 +#define SGT 93 +#define SLE 94 +#define SGE 95 +#define SNE 96 +#define SENDDO 97 +#define SWHILE 98 +#define SSLASHD 99 +#define SBYTE 100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/version.c new/src/version.c --- old/src/version.c 2019-03-11 21:45:16.000000000 +0100 +++ new/src/version.c 2020-09-16 21:33:17.000000000 +0200 @@ -1,2 +1,2 @@ -char F2C_version[] = "20190311"; -char xxxvers[] = "\n@(#) FORTRAN 77 to C Translator, VERSION 20190311\n"; +char F2C_version[] = "20200916"; +char xxxvers[] = "\n@(#) FORTRAN 77 to C Translator, VERSION 20200916\n"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/xsum0.out new/src/xsum0.out --- old/src/xsum0.out 2019-03-11 21:49:47.000000000 +0100 +++ new/src/xsum0.out 2020-09-17 00:54:09.000000000 +0200 @@ -1,20 +1,20 @@ Notice 76f23b4 1212 README f11dd32a 7973 cds.c 147aded1 4221 -data.c e53078ae 10697 +data.c 32116b2 10688 defines.h fd9fa7c5 8720 defs.h e48cebb 34523 equiv.c fdeff25 9340 error.c ef1dd812 5015 -exec.c e169a868 21191 +exec.c e8f52ce0 21217 expr.c 6bfe005 72276 f2c.1 b0441b2 7532 f2c.1t bf1f87 7574 f2c.h e770b7d8 4688 -format.c f97004df 59746 +format.c f00da069 59974 format.h b396862 458 -formatdata.c 11a95834 28870 -ftypes.h 9a0b38c 1616 +formatdata.c 1f0f56eb 28988 +ftypes.h e2533d86 1836 gram.c 3794117 64242 gram.dcl e38579ff 8463 gram.exec e20ca496 3033 @@ -31,29 +31,29 @@ makefile.u e0dd1cab 3710 makefile.vc eb8aae7c 2685 malloc.c 3505600 4020 -mem.c e54b227d 5437 +mem.c ad64d7c 5437 memset.c 12a1e1aa 2121 misc.c 8d99c9 22945 names.c fa887031 21553 names.h 110806d6 569 niceprintf.c 141fb644 10950 niceprintf.h c31f08c 412 -output.c ee3a3cc5 43483 +output.c ff23aa0b 43483 output.h fa6797d9 2103 p1defs.h 1b02743 5741 -p1output.c 6fd9954 14376 +p1output.c ff485aba 14681 parse.h 18d34e6b 1119 parse_args.c eb2fd4ea 14145 pccdefs.h 1b4fbbee 1195 -pread.c 1fbd30ab 17831 -proc.c e7d9505a 39179 +pread.c fb4d5427 17831 +proc.c e6d47490 39179 put.c af0be95 10345 putpcc.c 7669b2f 46093 -sysdep.c fe71c52a 15893 +sysdep.c f34bbeb6 15877 sysdep.h e7826434 2755 -sysdeptest.c c92b2d4 408 +sysdeptest.c 449a7d0 428 tokens 188b7c5d 733 usignal.h 1c4ce909 124 vax.c 8b21b83 12436 -version.c e8cfc56e 107 +version.c f5590e6a 107 xsum.c e05654a7 6653