Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated #208

Open
dschlaep opened this issue Jul 10, 2018 · 1 comment

Comments

@dschlaep
Copy link
Member

Replicate that warning by using clang++ as the compiler, i.e.,

CXX=clang++ make cleaner test test_run


clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]

(see, e.g., #206 (comment))

--> Solution: compile c code with CC (i.e., target lib_target_test etc.) and c++ code with CXX (i.e., targets test etc.)
--> Once this is resolved, remove -Wno-error=deprecated from makefile

@dschlaep dschlaep added this to the Code testing milestone Jul 10, 2018
dschlaep added a commit that referenced this issue Jul 10, 2018
- addressing #206: both clang and gcc work (at least locally)
* CXX=clang++ make clean test test_run
* CXX=g++ make clean test test_run

- don't overwrite standard flags such as CFLAGS, etc.
- ignore errors when cleaning up (prefix commands with a hyphen)
- ignore errors arising from deprecated warnings (as c code under clang++) --> remove once #208 is fixed

- target `clean` is now a synonym of `cleaner`
- first target is now `bin`, i.e., calling `make` will now compile the executable

- updated `SW_Output_mock.c`
This was referenced Jul 10, 2018
dschlaep added a commit that referenced this issue Jul 12, 2018
- close #213 (remove "-Werror" from production builds; now only used as part of `warning_flags_severe`)
- address #208 (resolved for `make test` because we now compile the library with CC and the test binary with CXX; not resolved for `make test_severe` and `make cov`)

- wrapped all c header files in "extern C" to avoid name mangling:
- fixed global variable definitions in file `test/sw_maintest.cc`

- makefile
* gained target `help`
* renamed targets `test` and `testci` to `test_severe` and `test`

- updated yml instructions of CIs
- updated README
@dschlaep
Copy link
Member Author

this is resolved for make target make test test_run, but not yet for make test_severe test_run or make cov test_run

dschlaep added a commit that referenced this issue Jul 17, 2018
Better compilation and use in rSOILWAT2

we have three documented and suppressed/ignored problems:
- memory leak (use of a suppression file): #205
- compile warning #208: treating c input as c++
- compile warning #214: variable array length
dschlaep added a commit that referenced this issue Apr 27, 2019
- previous commit eliminated all vla warnings successfully also on continuous integration checks --> close #214

- only remaining warning is "Wdeprecated" due to issue #208

- improved function `sw_error`: removed unnecessary parantheses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant