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

http: fix compiler warning with CURL_DISABLE_CRYPTO_AUTH #6509

Closed

Conversation

MarcelRaad
Copy link
Member

Declare conn only if CURL_DISABLE_CRYPTO_AUTH is not defined.
This fixes the following warning:

http.c:898:23: warning: unused variable 'conn' [-Wunused-variable]
898 | struct connectdata *conn = data->conn;

@MarcelRaad
Copy link
Member Author

Note: USE_SPNEGO is only defined if CURL_DISABLE_CRYPTO_AUTH is undefined.

Declare `conn` only if `CURL_DISABLE_CRYPTO_AUTH` is not defined.
This fixes the following warning:
```
http.c:898:23: warning: unused variable 'conn' [-Wunused-variable]
898 | struct connectdata *conn = data->conn;
```

Closes curl#6509
@MarcelRaad MarcelRaad force-pushed the disablecryptoauth_unusedvariable branch from b2edc70 to f185879 Compare January 23, 2021 09:30
struct connectdata *conn = data->conn;
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this rather be moved into the #ifdef USE_SPNEGO condition below? It would also match better with the actual use of the negstate variable which also depends on USE_SPNEGO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, it's also used in the #ifndef CURL_DISABLE_CRYPTO_AUTH block below for Digest.

@bagder
Copy link
Member

bagder commented Feb 5, 2021

Is this PR still necessary after ecb1341?

@MarcelRaad
Copy link
Member Author

No it isn't! Will close it.

@MarcelRaad MarcelRaad closed this Feb 5, 2021
@MarcelRaad MarcelRaad deleted the disablecryptoauth_unusedvariable branch February 5, 2021 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants