[clang] [flang] [flang][driver] Accept -fallow-argument-mismatch with a warning instead of rejecting it (PR #91611)

Andrzej WarzyƄski via cfe-commits cfe-commits at lists.llvm.org
Fri May 10 00:13:00 PDT 2024


banach-space wrote:

Thank you for this contribution Paul!

> Many autotools-utilizing projects (mpich among them) fail to complete the configure step since it tries to invoke the (unknown to them) Fortran compiler always with the -fallow-argument-mismatch flag.

It sounds like an issue with the `mpich` build script rather than LLVM Flang. Why would `mpich` and other projects use this flag to begin with? Do other Fortran compilers support it? 

>From GFrotran docs (https://gcc.gnu.org/onlinedocs/gfortran/Fortran-Dialect-Options.html):
> Using this option is strongly discouraged.

In general, I'm hesitant to allow such dummy flags that:
* do nothing,
* are there merely to prevent issues in build scripts.

Are there no other ways around it? We obviously should make it possible for LLVM Flang to build all projects, but I really want to avoid Flang containing multiple dummy flags only to work around build scripts that assume a particular compiler is used.

We might be missing some "gfortran compatibility mode" in Flang (on top of `FlangMode`). Such mode could allow unsupported GFortran flags and warn whenever those are used. `flang-new` would still "default" to `FlangMode` and just generate an error.

In any case, it would be good to get more opinions on this. @kiranchandramohan , anyone else might be interested in this?

https://github.com/llvm/llvm-project/pull/91611


More information about the cfe-commits mailing list