fortran-lang / fpm

Fortran Package Manager (fpm)
https://fpm.fortran-lang.org
MIT License
844 stars 95 forks source link

`-ffree-line-length-none` should be used by default in tests #1017

Open davidpfister opened 2 months ago

davidpfister commented 2 months ago

Description

Quite often I use cpp macro for defining assert functions in unit tests. Every now and then I end up we a very long line and because this is not possible to use & continuation line syntax in preprocessed macros, there is not much I can do about except passing the flag -ffree-line-length-none to gfortran.

Possible Solution

I would simply propose that this flag is used by default when running fpm test just not to see the message Error: Line truncated at (1) [-Werror=line-truncation]

Additional Information

No response

zoziha commented 2 months ago

Given that Fortran-2023 has been released, the line length limit has been relaxed to 10,000 characters, and ifort, ifx are open for this by default, and GFortran already implements the 10,000 character line length limit in -std=f2023 in GCC 14.0. It seems like adding -ffree-line-length-n or -ffree-line-length-10000 to GFortran in fpm would be a good choice in terms of keeping up with the latest developments and making it comfortable for users?