Skip to content

Fix Clang Compatibility and Remove Unused Variables#3735

Open
kai-ion wants to merge 1 commit intomainfrom
pr-3728
Open

Fix Clang Compatibility and Remove Unused Variables#3735
kai-ion wants to merge 1 commit intomainfrom
pr-3728

Conversation

@kai-ion
Copy link
Contributor

@kai-ion kai-ion commented Feb 25, 2026

Issue #, if available:

Description of changes:
This commit improves compatibility with Clang on Windows and MinGW platforms by refining preprocessor conditionals that disable specific compiler warnings. The previous checks only tested for _WIN32 or MINGW32, but Clang on these platforms does not require the same warning suppressions, leading to unnecessary or incorrect pragma directives.

Additionally, removes unused variables in OSVersionInfo.cpp and corrects the loop index type in WinHttpSyncHttpClient.cpp to use size_t instead of int. The member initialization order in WinHttpSyncHttpClient's constructor has been reordered to match the declaration order in the class definition.

  • Compiler warning pragmas (AwsCppSdkGTestSuite.h, EventHeader.h, GeneralHTTPCredentialsProviderTest.cpp)
  • Unused variable cleanup (OSVersionInfo.cpp)
  • Type safety improvements (WinHttpSyncHttpClient.cpp)

** Generated by CodeLite. **

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This commit improves compatibility with Clang on Windows and MinGW platforms
by refining preprocessor conditionals that disable specific compiler warnings.
The previous checks only tested for _WIN32 or __MINGW32__, but Clang on these
platforms does not require the same warning suppressions, leading to
unnecessary or incorrect pragma directives.

Additionally, removes unused variables in OSVersionInfo.cpp and corrects the
loop index type in WinHttpSyncHttpClient.cpp to use size_t instead of int.
The member initialization order in WinHttpSyncHttpClient's constructor has
been reordered to match the declaration order in the class definition.

* Compiler warning pragmas (AwsCppSdkGTestSuite.h, EventHeader.h, GeneralHTTPCredentialsProviderTest.cpp)
* Unused variable cleanup (OSVersionInfo.cpp)
* Type safety improvements (WinHttpSyncHttpClient.cpp)

** Generated by CodeLite. **

Signed-off-by: Eran Ifrah <eran@codelite.org>
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