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: compare result to IOTHUB_CLIENT_CONNECTION_AUTHENTICATED #2666

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Nostracodus
Copy link

@Nostracodus Nostracodus commented Feb 6, 2025

Checklist

  • I have read the [contribution guidelines] (https://github.com/Azure/azure-iot-sdk-c/blob/main/.github/CONTRIBUTING.md).
  • I added or modified the existing tests to cover the change (we do not allow our test coverage to go down).
  • If this is a modification that impacts the behavior of a public API
    • I edited the corresponding document in the devdoc folder and added or modified requirements.
  • I submitted this PR against the correct branch:
    • This pull-request is submitted against the main branch.
    • I have merged the latest main branch prior to submission and re-merged as needed after I took any feedback.
    • I have squashed my changes into one with a clear description of the change.

Description of the problem

I work on Microsoft's Visual C++ compiler. This repo is one of the repos we regularly build as part of our outer dev loop. A recently implemented warning detected this instance of implicit enum conversion (comparing two values of different enum types).

This appears to be a theoretical bug. The enumerators that are being used in the comparison have the same values (and so the comparison behavior is unchanged), but other uses of this enumeration type in the repo suggest that this coercion was unintentional.

Description of the solution

I modified the comparison to use the IOTHUB_CLIENT_CONNECTION_AUTHENTICATED enumerator, as other instances of the repo seem to do.

This appears to be a theoretical bug. The sample code is comparing two values
of disparate enum types. The enumerators that are being used in the comparison
have the same values (and so the comparison behavior is valid), but other uses of
this enumeration type suggest that this was a typo.
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.

1 participant