From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,816e95a3ecab514e,start X-Google-Attributes: gidfee84,public X-Google-Thread: 1164f8,816e95a3ecab514e,start X-Google-Attributes: gid1164f8,public X-Google-Thread: 10b612,816e95a3ecab514e,start X-Google-Attributes: gid10b612,public X-Google-Thread: 1094ba,816e95a3ecab514e,start X-Google-Attributes: gid1094ba,public X-Google-ArrivalTime: 1994-02-26 06:43:40 PST Xref: gmd.de comp.sys.dec:13581 comp.lang.fortran:10358 comp.unix.osf.osf1:2325 comp.unix.ultrix:13115 Newsgroups: comp.sys.dec,comp.lang.fortran,comp.unix.osf.osf1,comp.unix.ultrix Path: gmd.de!newsserver.jvnc.net!netnews.upenn.edu!msuinfo!agate!howland.reston.ans.net!cs.utexas.edu!uunet!news.univie.ac.at!edvz.sbg.ac.at!gwesp From: gwesp@wst.edvz.sbg.ac.at (Wesp Gerhard) Subject: Interesting Fortran Behaviour Message-ID: Sender: news@wst.edvz.sbg.ac.at (USENET News System) Organization: University of Salzburg / Austria X-Newsreader: TIN [version 1.2 PL1] Date: Thu, 24 Feb 1994 12:16:32 GMT Consider the following little C and Fortran programs: --- 4711.c ------------------------- #include void main() { int i; for(i= 1; i <= 4000; i++) printf("4711.47114711\n"); } ------------------------------------ This just prints the number 4711.47114711 to stdout 4000 times and then terminates. --- crunch.f ----------------------- program crunch integer i double precision a do 4711 i= 1, 4000 read *, a 4711 continue print *, 'read 4000 numbers' end ------------------------------------ This trys to read 4000 numbers from stdin, and, if successfully, prints the message 'read 4000 numbers' to stdout and terminates. So what would you expect if you connect those two programs by a pipe, e.g. "4711 | crunch"? Well, 4711 should produce 4000 numbers, crunch should con- sume them and happily terminate with 'read 4000 numbers'. And that's exactly what it does on a good old Tektronix m88k workstation. However, on our new ALPHA workstations with DEC OSF1 V1.3, DEC Fortran and the DEC C-compiler, the following happens (shell is csh): % l total 4 drwxr-xr-x 2 wesp rist 512 Feb 24 11:34 ./ drwxr-xr-x 7 wesp rist 512 Feb 23 14:42 ../ -rw-r--r-- 1 wesp rist 108 Feb 24 10:14 4711.c -rw-r--r-- 1 wesp rist 181 Feb 24 10:24 crunch.f % make 4711 crunch cc -O 4711.c -o 4711 f77 -O crunch.f -o crunch % while(1) ? 4711 | crunch ? end read 4000 numbers read 4000 numbers forrtl: severe: input record too long, unit 5, file stdin read 4000 numbers read 4000 numbers read 4000 numbers read 4000 numbers forrtl: severe: input record too long, unit 5, file stdin [...] forrtl: severe: input record too long, unit 5, file stdin read 4000 numbers read 4000 numbers read 4000 numbers forrtl: severe: input record too long, unit 5, file stdin read 4000 numbers read 4000 numbers forrtl: severe: input record too long, unit 5, file stdin [...] It seems that every fifth time or so "crunch" terminates with the error message "forrtl: severe: input record too long, unit 5, file stdin". On our DECstations under Ultrix it's even worse: % while(1) ? 4711 | crunch ? end forrtl: severe: input record too long, unit 5, file stdin forrtl: severe: input record too long, unit 5, file stdin forrtl: severe: input record too long, unit 5, file stdin forrtl: severe: input record too long, unit 5, file stdin [...] However, if I pipe the 4711 output into a file ("4711 > tmpfile"), "crunch < tmpfile" always works correctly! What am I missing? Greetings, -Gerhard