f77 signed ichar. How read unsigned ichar

Bjørn Elstad Bjorn.Elstad@ephorma.no
Thu Aug 23 08:27:00 GMT 2001


The problem:

I find no way to ensure that g77  2.96 ... behaves compatible with what I 
believe is Fortran 77. My example is ICHAR.

I have tried reading documentation and the only startup parameter i
have been able to use.



What shall I do?



Redhat linux verson:

Seawolf 

Linux kernel stuff:


Linux altair 2.4.9 #1 SMP Fri Aug 17 14:51:04 CEST 2001 i686 unknown



g77 stuff:

g77 version 2.96 20000731 (Red Hat Linux 7.1 2.96-81) (from FSF-g77 version
0.5.26 20000731 (Red Hat Linux 7.1 2.96-81))
Driving: g77 -v -c -xf77-version /dev/null -xnone
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/tradcpp0 -lang-fortran -v
-D__GNUC__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix
-Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix)
-Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -D__tune_i386__
/dev/null /dev/null
GNU traditional CPP version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/f771 -fnull-version -quiet
-dumpbase g77-version.f -version -fversion -o /tmp/cck4s7KT.s /dev/null
GNU F77 version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)
(i386-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat Linux
7.1 2.96-81).
GNU Fortran Front End version 0.5.26 20000731 (Red Hat Linux 7.1 2.96-81)
 as -V -Qy -o /tmp/ccic2voC.o /tmp/cck4s7KT.s
GNU assembler version 2.10.91 (i386-redhat-linux) using BFD version
2.10.91.0.2
 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o /tmp/ccAQAwGm
/tmp/ccic2voC.o /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crti.o
/usr/lib/gcc-lib/i386-redhat-linux/2.96/crtbegin.o
-L/usr/lib/gcc-lib/i386-redhat-linux/2.96
-L/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../.. -lg2c -lm -lgcc -lc -lgcc
/usr/lib/gcc-lib/i386-redhat-linux/2.96/crtend.o
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crtn.o
 /tmp/ccAQAwGm
__G77_LIBF77_VERSION__: 0.5.26 20000731 (prerelease)
@(#)LIBF77 VERSION 19991115
__G77_LIBI77_VERSION__: 0.5.26 20000731 (prerelease)
@(#) LIBI77 VERSION pjw,dmg-mods 19991115
__G77_LIBU77_VERSION__: 0.5.26 20000731 (prerelease)
@(#) LIBU77 VERSION 19980709



gcc stuff :


Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)



env  and locale stuff:





PWD=/home/sift/sift/v3505/work/testing
pod=/usr/lib/perl5/5.00503/pod
WINDOWID=33554446
HOSTNAME=altair
HISTFILESIZE=50
LESSOPEN=|/usr/bin/lesspipe.sh %s
SOCKS_NS=127.0.0.1
BROWSER=/usr/bin/netscape
USER=sift
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;
33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=0
1;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:
*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;
31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.
gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
MACHTYPE=i386-redhat-linux-gnu
MAIL=/var/spool/mail/sift
INPUTRC=/etc/inputrc
BASH_ENV=/home/sift/.bashrc
data=/home/sift/ephorma/appl/data
DISPLAY=:0.0
LOGNAME=sift
SHLVL=3
SESSION_MANAGER=local/altair:/tmp/.ICE-unix/406
SHELL=/bin/bash
USERNAME=
HOSTTYPE=i386
CVSROOT=/home/sift/cvsroot
OSTYPE=linux-gnu
HISTSIZE=50
HOME=/home/sift
TERM=xterm
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/sift/bin:./
OLDPWD=/home/sift/sift/v3505/work
_=/usr/bin/env


Locale stuff:


LANG=POSIX
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=


 <<ABC>>  <<ABC.F>>  <<ABC.LIS>>  <<ABC.T>>  <<ABCU.C>>  <<MAKEFILE>>  
<<README.TXT>> 


- bjørn

=================
Bjørn Elstad, Ephorma AS 
Email: bjorn.elstad@ephorma.no
Tlf: 0 23 26 (sentralbord)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ABC
Type: application/x-executable
Size: 91444 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20010823/25cc1e8a/attachment.bin>
-------------- next part --------------
           program abc
           implicit integer*4 (a-z)
           character(*) i1
           parameter (i1="abc???ABC???")
           character*(256) itxt


           write (*,*) "Read by means of  c-routiner"
           i = uxgets (itxt, ncb)
           do 200 ix=1,ncb, 1
             write (*,*) itxt(ix:ix), ":", ichar (itxt(ix:ix)) 
200        continue

          

           write (*,*) "Read by means of  fortran-routiner"
           iu = 20
           open (iu, file="abc.t", access="sequential")
           read (iu, *) itxt
           do 300 ix = 255, 1, -1
             if (itxt(ix:ix) .ne. " ") goto 330
300        continue
330        continue
           ncb = ix
           do 400 ix=1,ncb, 1
             write (*,*) itxt(ix:ix), ":", ichar (itxt(ix:ix)) 
400        continue

           
           write (*,*) "Printing result of parameter statement"
           do 500 ix=1,len(i1), 1
             write (*,*) i1(ix:ix), ":", ichar (i1(ix:ix)) 
500        continue


           call abc2

 
           end

           subroutine abc2
           integer*4 ix
           character*(*) c1
           parameter (c1 = "ABC???abc???")

           write (*,*) "No implicit statement"
           write (*,*) "Printing result of parameter statement"
           do 500 ix=1,len(c1), 1
             write (*,*) c1(ix:ix), ":", ichar (c1(ix:ix)) 
500        continue

           return
           end











-------------- next part --------------
 Read by means of  c-routiner
 a: 97
 b: 98
 c: 99
 ?: -26
 ?: -8
 ?: -27
 A: 65
 B: 66
 C: 67
 ?: -58
 ?: -40
 ?: -59
 Read by means of  fortran-routiner
 a: 97
 b: 98
 c: 99
 ?: -26
 ?: -8
 ?: -27
 A: 65
 B: 66
 C: 67
 ?: -58
 ?: -40
 ?: -59
 Printing result of parameter statement
 a: 97
 b: 98
 c: 99
 ?: -26
 ?: -8
 ?: -27
 A: 65
 B: 66
 C: 67
 ?: -58
 ?: -40
 ?: -59
 Declare function ichar integer *4 
 Printing result of parameter statement
 A: 65
 B: 66
 C: 67
 ?: -58
 ?: -40
 ?: -59
 a: 97
 b: 98
 c: 99
 ?: -26
 ?: -8
 ?: -27
-------------- next part --------------
abc???ABC???
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ABCU.C
Type: text/x-c
Size: 262 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20010823/25cc1e8a/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MAKEFILE
Type: text/x-makefile
Size: 65 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20010823/25cc1e8a/attachment-0002.bin>


More information about the Gcc-bugs mailing list