[cfe-dev] RFC: Fortran optoins in Clang

Andrzej Warzynski via cfe-dev cfe-dev at lists.llvm.org
Thu Apr 8 07:59:25 PDT 2021


Hello,

What should Clang do when using options that are reserved for Flang 
(i.e. that only make sense for Fortran input)? Should this be a warning 
or an error?

Currently Clang will issue an error. This is problematic to some users 
and was brought up in a post-commit review for 
https://reviews.llvm.org/D95460. GCC is more forgiving in such scenarios:
```
gcc -c  -ffree-form  file.c
cc1: warning: command line option ‘-ffree-form’ is valid for Fortran but 
not for C
```
I propose that we introduce similar logic in Clang. A patch implementing 
this is available here: https://reviews.llvm.org/D99353.

This is a user-facing change and I want to make sure that this works for 
everyone. Your feedback is much appreciated!

-Andrzej


More information about the cfe-dev mailing list