# Is the gfortran flag -ffree-line-length-0 necessary for f95 files?

**URL:** <https://fortran-lang.discourse.group/t/is-the-gfortran-flag-ffree-line-length-0-necessary-for-f95-files/2067>\
**Category:** Help\
**Created:** [October 14, 2021, 1:13am UTC](https://fortran-lang.discourse.group/t/is-the-gfortran-flag-ffree-line-length-0-necessary-for-f95-files/2067 "2021-10-14T01:13:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![fortran4r](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@fortran4r](https://fortran-lang.discourse.group/u/fortran4r)\
**Post date:** [October 14, 2021, 1:13am UTC](https://fortran-lang.discourse.group/t/is-the-gfortran-flag-ffree-line-length-0-necessary-for-f95-files/2067/1 "2021-10-14T01:13:56Z")

</div>

Is the gfortran flag -ffree-line-length-0 necessary for f95 files? My understanding is that if my Fortran file has the .f95 extension, gfortran will automatically apply the flag -ffree-line-length-0. Is my understanding correct?

---

<div class="post-metadata">

**Author:** ![Euler-37](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@Euler-37](https://fortran-lang.discourse.group/u/Euler-37)\
**Post date:** [October 14, 2021, 1:58am UTC](https://fortran-lang.discourse.group/t/is-the-gfortran-flag-ffree-line-length-0-necessary-for-f95-files/2067/2 "2021-10-14T01:58:24Z")

</div>

As gfortran Manual  
[GNU Fortran Manual](https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gfortran/Fortran-Dialect-Options.html#Fortran-Dialect-Options)

> `-ffree-line-length-n`
> 
> Set column after which characters are ignored in typical free-form lines in the source file. The default value is 132. n may be ‘none’, meaning that the entire line is meaningful. -ffree-line-length-0 means the same thing as -ffree-line-length-none.

if exceed, the compile error shows below

```auto
1.f90:3:132:

Error: Line truncated at (1) [-Werror=line-truncation]

```

---

<div class="post-metadata">

**Author:** ![shahmoradi](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/shahmoradi/32/3151_2.png) [@shahmoradi](https://fortran-lang.discourse.group/u/shahmoradi)\
**Post date:** [October 14, 2021, 2:49am UTC](https://fortran-lang.discourse.group/t/is-the-gfortran-flag-ffree-line-length-0-necessary-for-f95-files/2067/3 "2021-10-14T02:49:48Z")

</div>

Yes, It’s good to put this “-ffree-line-length-none” on the command line with gfortran, otherwise, the default max line length is 132 characters, which I find to be miserably short for any modern 4K monitor. The next Fortran standard is set to hopefully resolve the need for this flag. I think the Intel compiler allows virtually unlimited line length, by default.

---

<div class="post-metadata">

**Author:** ![Beliavsky](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Beliavsky](https://fortran-lang.discourse.group/u/Beliavsky)\
**Post date:** [October 14, 2021, 3:01am UTC](https://fortran-lang.discourse.group/t/is-the-gfortran-flag-ffree-line-length-0-necessary-for-f95-files/2067/4 "2021-10-14T03:01:16Z")

</div>

Not answering your question, but I recommend not using the .f95 extension. The .f90 extension indicates that a code uses free source form, not that the code conforms to the Fortran 90 standard (which did introduce free source form).

---

<div class="post-metadata">

**Author:** ![fortran4r](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@fortran4r](https://fortran-lang.discourse.group/u/fortran4r)\
**Post date:** [October 14, 2021, 3:05am UTC](https://fortran-lang.discourse.group/t/is-the-gfortran-flag-ffree-line-length-0-necessary-for-f95-files/2067/5 "2021-10-14T03:05:46Z")

</div>

so gfortran will use -ffree-line-length-0 by default in the future? when will this happen?

---

<div class="post-metadata">

**Author:** ![shahmoradi](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/shahmoradi/32/3151_2.png) [@shahmoradi](https://fortran-lang.discourse.group/u/shahmoradi)\
**Post date:** [October 14, 2021, 3:08am UTC](https://fortran-lang.discourse.group/t/is-the-gfortran-flag-ffree-line-length-0-necessary-for-f95-files/2067/6 "2021-10-14T03:08:57Z")

</div>

With the next standard release  
[https://j3-fortran.org/doc/year/19/19-138r1.txt](https://j3-fortran.org/doc/year/19/19-138r1.txt)

---

<div class="post-metadata">

**Author:** ![fortran4r](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@fortran4r](https://fortran-lang.discourse.group/u/fortran4r)\
**Post date:** [October 14, 2021, 5:02am UTC](https://fortran-lang.discourse.group/t/is-the-gfortran-flag-ffree-line-length-0-necessary-for-f95-files/2067/7 "2021-10-14T05:02:44Z")

</div>

A side question, is there any plan to make -fimplicit-none the default flag for gfortran?

---

<div class="post-metadata">

**Author:** ![MarDie](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/mardie/32/54_2.png) [@MarDie](https://fortran-lang.discourse.group/u/MarDie)\
**Post date:** [October 14, 2021, 6:13am UTC](https://fortran-lang.discourse.group/t/is-the-gfortran-flag-ffree-line-length-0-necessary-for-f95-files/2067/8 "2021-10-14T06:13:45Z")

</div>

Even if it would be default, flags like `-std=f2018` would need to enable it again to conform with the respective standard.

---

<div class="post-metadata">

**Author:** ![epagone](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/epagone/32/252_2.png) [@epagone](https://fortran-lang.discourse.group/u/epagone)\
**Post date:** [October 14, 2021, 12:21pm UTC](https://fortran-lang.discourse.group/t/is-the-gfortran-flag-ffree-line-length-0-necessary-for-f95-files/2067/9 "2021-10-14T12:21:45Z")

</div>

I know that there is the [proposal](https://github.com/fortran-lang/fpm/issues/359) to make it the default for fpm, but I am biased 😉 😃
