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

Fix a gcc 11 warning in src/threadstate.c #6115

Merged
merged 1 commit into from
Nov 14, 2021

Conversation

lhchavez
Copy link
Contributor

When building under gcc 11, there is a warning about a misaligned guard clause
because there were mixed spaces and tabs:

[128/634] Building C object src/CMakeFiles/git2internal.dir/threadstate.c.o
../src/threadstate.c: In function ‘threadstate_dispose’:
../src/threadstate.c:39:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   39 |     if (threadstate->error_t.message != git_str__initstr)
      |     ^~
../src/threadstate.c:41:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   41 |         threadstate->error_t.message = NULL;
      |         ^~~~~~~~~~~
../src/threadstate.c: At top level:

This change indents the code with tabs for consistency with the rest of the
code, which makes the warning go away.

When building under gcc 11, there is a warning about a misaligned guard clause
because there were mixed spaces and tabs:

```
[128/634] Building C object src/CMakeFiles/git2internal.dir/threadstate.c.o
../src/threadstate.c: In function ‘threadstate_dispose’:
../src/threadstate.c:39:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   39 |     if (threadstate->error_t.message != git_str__initstr)
      |     ^~
../src/threadstate.c:41:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   41 |         threadstate->error_t.message = NULL;
      |         ^~~~~~~~~~~
../src/threadstate.c: At top level:
```

This change indents the code with tabs for consistency with the rest of the
code, which makes the warning go away.
@ethomson ethomson merged commit 03132b3 into libgit2:main Nov 14, 2021
@ethomson
Copy link
Member

Thanks! 👍

@ethomson ethomson added the bug label Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants