Skip to content

util/rand: Fix unused variable warning when building without threads - #6358

Closed
tomasskare wants to merge 1 commit into
libgit2:mainfrom
tomasskare:no-threads-fix-warning
Closed

util/rand: Fix unused variable warning when building without threads#6358
tomasskare wants to merge 1 commit into
libgit2:mainfrom
tomasskare:no-threads-fix-warning

Conversation

@tomasskare

Copy link
Copy Markdown

When building with USE_THREADS=OFF (GIT_THREADS not defined), the
state_lock variable was still defined, but never used, causing a
warning.

When building with USE_THREADS=OFF (GIT_THREADS not defined), the
state_lock variable was still defined, but never used, causing a
warning.
@ethomson

Copy link
Copy Markdown
Member

Yikes - we definitely aim to be warning free. I'm disappointed that our threads=off nightly build missed this -- possibly just because it's an older compiler. This one is a little subtle, it's the #define to git__noop that drops the argument.

I'd like to avoid that #ifdef if possible -- I opened #6432 with an alternate approach.

@ethomson

ethomson commented Feb 9, 2023

Copy link
Copy Markdown
Member

(Fixed via #6432)

@ethomson ethomson closed this Feb 9, 2023
@tomasskare
tomasskare deleted the no-threads-fix-warning branch February 9, 2023 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants