RFC: silence benign warning with pragma #3263
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Disclaimer: I don't have a system to reproduce the warning, and test the fix, on so this is perhaps more of a discussion piece than a patch. Anyways, here goes.
Commit 5bfaa86 introduced a new compiler warning on Windows cross compilation with GCC. The coding is however a documented pattern for acquiring a handle to write to, so rather than changing working code this wraps the offending cast in a GCC diagnostic pragma to silence the warning. See below for an example of the warning from the autobuild logs:
An example failing build can be found here: https://curl.haxx.se/dev/log.cgi?id=20181111190642-17820#prob1