-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Clang support to edgesec #242
Conversation
C11 officially doesn't supported C++11 raw-strings. GNU does, but this doesn't work on Clang.
Disables GNU/Clang C extension by default on all code, except: - lib/libnetlink (taken from Linux kernel) - lib/libpcap (uses a bunch of BSD-style u_int) - any file that defined `#_GNU_SOURCE` (or similar)
Currently, we aren't passing CC/CXX to our all of our dependencies in `lib/`. This means that CC/CXX are just loaded from the value of CC/CXX in our environment (not any CMake overrides (e.g. in CMakeToolchain file). This commit explicitly passes them.
The ubuntu-20.04 image of GitHub Actions defaults to Clang 11. However, the only version of LLVM that can be easily installed is LLVM 10, which is not compatible with Clang 11.
Codecov Report
@@ Coverage Diff @@
## main #242 +/- ##
==========================================
- Coverage 47.95% 45.77% -2.19%
==========================================
Files 110 107 -3
Lines 16212 16564 +352
==========================================
- Hits 7775 7582 -193
- Misses 8437 8982 +545
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Huh, I've got no idea why adding Clang is changing the code-coverage values by so much (maybe it calculates lines slightly differently?). But Clang seems to be working, so I'll mark this PR as ready to review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great
Adds initial basic support for compiling EDGESec with Clang.
Disables GNU/Clang C extensions by default on the edgesec code, except:
#_GNU_SOURCE
(or similar)Additionally, I've removed some GNU only features, like
C++11
-styled rawstrings.Finally, I've added a CI job for Clang so it'll be tested. It even has code-coverage added!