haskell / haskell/c2hs

Fails on Darwin with "clang: error: no input files"

Open
#282 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
211
Forks
52
PR merge metrics
No merged PRs in 30d

Description

```
$ c2hs external/c2hs_repo/Baz.chs -o out//Baz.hs --cpp /usr/bin/cpp -C-includeghcplatform.h -C-includeghcversion.h -C-iquote
clang: error: no input files
```

Seems Darwin's `cpp` is behaving similar to the "openbsd" variant regarding the `-xc` vs. `-x c` flags:

```console
bash-3.2$ which cpp
/usr/bin/cpp

bash-3.2$ cpp --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

bash-3.2$ cpp -x c foo.c
clang: error: no input files
```
I guess the `cppopts` function could use a little update?

https://github.com/haskell/c2hs/blob/e05db30aaec217f2b158cb1678625512c51f5c5d/src/C2HS/Config.hs#L53-L67

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.