Author Topic: Help! "Line truncated" error for 73 columns Fortran compiler  (Read 405 times)

Offline petermunich

  • Single posting newcomer
  • *
  • Posts: 2
Help! "Line truncated" error for 73 columns Fortran compiler
« on: August 27, 2020, 09:12:50 pm »
Hi,
First time to use Code::Blocks for Fortran coding.

I have lots of Fortran source files to compile. But many Fortran source files have lines longer than 73 columns/characters, then I got lots of warning and errors. "Warning: Line truncated  [-Wline-truncation]".
My question is: is there anyway to make Code::Blocks to read completely each line, even longer than 73 characters?
How to do that?

Thank you very much!

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6983
    • My Best Post
Re: Help! "Line truncated" error for 73 columns Fortran compiler
« Reply #1 on: August 28, 2020, 04:52:30 am »
What compiler are you using? Code::Blocks is not a Compiler (it sometimes installs a Compiler under Windows OS)
What is the file extension that is having the problem?

Edit: If you post a build log you might get help from a FORTRAN user; there are few if any FORTRAN users on this forum.
Link to how to post a full build log.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Tim S.
« Last Edit: August 28, 2020, 06:45:11 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MaxGaspa

  • Almost regular
  • **
  • Posts: 129
Re: Help! "Line truncated" error for 73 columns Fortran compiler
« Reply #2 on: August 29, 2020, 07:47:47 pm »
I have lots of Fortran source files to compile. But many Fortran source files have lines longer than 73 columns/characters, then I got lots of warning and errors. "Warning: Line truncated  [-Wline-truncation]".
My question is: is there anyway to make Code::Blocks to read completely each line, even longer than 73 characters?
How to do that?

Fortran source file may use fixed or free form. Source code using fixed form can have lines up to a maximum of 72 characters. I am old enough....  ;D  and so I used cards and punching machine to write Fortran 66 code. The card has 80 colums and the last 8 were used for....well imagine what happened when a deck dropped on the floor, you need a way to reorder that cards and the last 8 colums were used to punch sequence numbers.

So in fixed form the maximum length is 72. In free form...it depends. GNU Fortran, since Fortran 90, is using a free form with 132 characters. Intel Fortran is uisng 2048. There are also continuation characters to manage longer lines

In case you are using GNU Fortran I copying and pasting some text lines from the manual

------------------------------------------------------------------------------------------------------------------------------
The following options control the details of the Fortran dialect accepted by the compiler:

-ffree-form
-ffixed-form

    Specify the layout used by the source file. The free form layout was introduced in Fortran 90. Fixed form was traditionally used in older Fortran programs. When neither option is specified, the source form is determined by the file extension.


-------------------------------------------------------------------------------------------------------------------------------

Hope this helps

Max
 
« Last Edit: August 29, 2020, 07:49:29 pm by MaxGaspa »