Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: petermunich on August 27, 2020, 09:12:50 pm

Title: Help! "Line truncated" error for 73 columns Fortran compiler
Post by: petermunich 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!
Title: Re: Help! "Line truncated" error for 73 columns Fortran compiler
Post by: stahta01 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 (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)

Tim S.
Title: Re: Help! "Line truncated" error for 73 columns Fortran compiler
Post by: Max 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