llvm / llvm/llvm-project

Flang accepts -module-dir as short-style option

Open
#168,740 3 comments 0 reactions 1 assignee Claimed by @tarunprabhu View on GitHub
flang:driver
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

f820625503744472be8312bb70ee0da197816067 claims that gfortran would treat `-module-dir` exactly like `-J`. This is not thee case:

```
$ gfortran -J/home/meinersbur/finclude
gfortran: fatal error: no input files
$ gfortran -module-dir/home/meinersbur/finclude
gfortran: error: unrecognized command-line option ‘-module-dir/home/meinersbur/finclude’
```

But flang accepts both:
```
$ flang -J/home/meinersbur/finclude
flang-22: error: no input files
$ gfortran -module-dir/home/meinersbur/finclude
flang-22: error: no input files
```

Flang is confusing short- and long-format command line arguments. The way to pass argument to long-style option is one of:
```
$ flang -module-dir=/home/meinersbur/finclude
flang-22: error: no input files
$ flang -module-dir /home/meinersbur/finclude
flang-22: error: no input files
```
The consequence is that if flang would introduce a new option such as `-module-directives`, it could not be distiguished from `-module-dir=ectives`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.