Skip to content

Fix Clang Compatibility and Remove Unused Variables#3728

Open
eranif wants to merge 1 commit intoaws:mainfrom
eranif:mingw-clang64
Open

Fix Clang Compatibility and Remove Unused Variables#3728
eranif wants to merge 1 commit intoaws:mainfrom
eranif:mingw-clang64

Conversation

@eranif
Copy link

@eranif eranif commented Feb 22, 2026

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.

NOTE: this PR is only completed when applied with this PR (to the aws-c-common repo):
awslabs/aws-c-common#1236

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

Note that this PR partially fixes: #3481 (at least the Bedrock API).

Generated by CodeLite

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>
@kai-ion
Copy link
Contributor

kai-ion commented Feb 25, 2026

Thanks for the update!

The AWS SDK for C++ currently builds with MinGW as part of our Windows CI. Since this change adjusts preprocessor conditionals around MinGW/Clang and touches WinHttpSyncHttpClient and OSVersionInfo, I’ll run this PR through our CI to make sure it doesn’t introduce any regressions to the existing MinGW builds.

@eifrah-aws
Copy link

Thanks for the update. I will fix the clang-format issue and will update the PR.

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.

Add support for building with MinGW

3 participants