bug in g77 compiler on linux

Toon Moene toon@moene.indiv.nluug.nl
Mon Jul 15 04:28:00 GMT 2002


banu mathi wrote:

> THE PROJECT I AM WORKING ON IS PORTING VAX/VMS BASED
> TEST TOOL TO LINUX REDHAT 6.2 PLATFORM. THE LANGUAGE
> IS FORTRAN 77. IT IS FOR AERONAUTICAL DEVELOPMENT
> ESTABLISHMENT, INDIA. THE ORGANIZATION COMES UNDER
> MINISTRY OF DEFENCE, INDIA.
> THE PROBLEM IS CONVERTING A ASCII FILE CONTAINING
> HEXADECIMAL VALUE TO BINARY. IN THE G77 COMPILER,
> CHARACTER SET '10' STANDS FOR NEWLINE. IN THE BINARY
> FILE WHENEVER 'A' COMES IN THE FIRST POSITION OR IN
> THE THIRD POSITION PRECEEDED BY ZEROS '0A00' OR '000A'
> THE G77 COMPILER GIVES '20' IN PLACE OF '10'. THE '20'
> IS THE HEXA VALUE FOR SPACE WERE AS THE '10' IS THE
> DECIMAL VALUE FOR 'A'. SO THE DECIMAL VALUE OF '20' IS
> '32'. THE G77 GIVES A WRONG DECIMAL VALUE FOR 'A'.
> PL GIVE ME INFO AS HOW TO OVER COME THIS PROBLEM.

Could you give us a small example of what you're trying to do (i.e. a
small program that reads just one line and a sample input file) ?

It looks to me you're trying to do something contradictory, namely
reading "binary" data with an '(A)' format, which is clearly impossible
- '(A)' formats are used for reading strings (ASCII data) - they cannot
be used for reading arbitrary binary data.

Hope this helps,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)



More information about the Gcc-bugs mailing list