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

Mandate C90 conformance #6771

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

GravisZro
Copy link

This PR ensures and enforces C90 conformance for all files C, including tests.

  • Modify CMakeLists.txt to mandate C90 conformance (for better compiler compatibility)
  • Update deps/ntlmclient/utf8.h to the latest version
  • Modify two tests and one header to use C comments instead of C++ comments

This PR ensures and enforces C90 conformance for all files C, including tests.

* Modify CMakeLists.txt to mandate C90 conformance (for better compiler compatibility)
* Update deps/ntlmclient/utf8.h to latest version
* Modify two tests and one header to use C comments instead of C++ comments
@ethomson
Copy link
Member

It's strange that only the MemorySanitizer build has trouble with the // comments in the mbedTLS includes.

@ethomson
Copy link
Member

It's strange that only the MemorySanitizer build has trouble with the // comments in the mbedTLS includes.

It looks like it’s only a problem on one platform, not sure why, but I’m happy to merge this once it’s working across platforms.

@GravisZro
Copy link
Author

It looks like it’s only a problem on one platform, not sure why, but I’m happy to merge this once it’s working across platforms.

I can't figure out how to replicate the memory sanitizer build locally. Is there a script to replicate the automated CI builds?

@ethomson
Copy link
Member

ethomson commented Apr 3, 2024

Yes — for reproducibility, most of our builds run in containers. For the memory sanitizer build, we use Ubuntu noble, and you can use our pre-built container.

Then you should be able to replicate the build step by setting the appropriate environment variables for the msan build, and running the CI build script.

Something along the lines of:

export CC="clang"
export CFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer"
export CMAKE_OPTIONS="-DCMAKE_PREFIX_PATH=/usr/local/msan -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON"
export CMAKE_GENERATOR="Ninja"
export SKIP_SSH_TESTS="true"
export SKIP_NEGOTIATE_TESTS="true"
export ASAN_SYMBOLIZER_PATH="/usr/bin/llvm-symbolizer-10"
export UBSAN_OPTIONS="print_stacktrace=1"
/path/to/libgit2/ci/setup-sanitizer-build.sh
/path/to/libgit2/ci/build.sh
/path/to/libgit2/ci/test.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants