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 some compile warnings on Win (VS 2022). #5163

Merged
merged 5 commits into from
Mar 23, 2023
Merged

Conversation

davidpanderson
Copy link
Contributor

Remove outdated stuff (e.g. VS has snprintf() now).

I'd like to have a clean build (no warnings) on both VS and gcc. Currently VS has a bunch of printf code warnings in diagnostics.cpp, diagnostics_win.cpp, and stackwalker_win.cpp. These should be easy to fix.
gcc has a bunch of sprintf buffer-size warnings, not easy to fix. There are lots of warnings in zip (to be fixed with vcpkg?) and in old graphics code.

Remove outdated stuff (e.g. VS has snprintf() now).

I'd like to have a clean build (no warnings) on both VS and gcc.
Currently VS has a bunch of printf code warnings in
diagnostics.cpp, diagnostics_win.cpp, and stackwalker_win.cpp.
These should be easy to fix.
gcc has a bunch of sprintf buffer-size warnings, not easy to fix.
There are lots of warnings in zip (to be fixed with vcpkg?)
and in old graphics code.
@AenBleidd
Copy link
Member

There are lots of warnings in zip (to be fixed with vcpkg?)

Yep. I want to remove this old 3rdparty libraries from our repo and install them as a dependencies.
Will probably work on this for the next minor release

@davidpanderson, could you please fix build errors meanwhile?
Thank you in advance

@AenBleidd
Copy link
Member

Currently manager build on linux vcpkg ix expected to fail. I'm working on a fix.
Everything else should work fine

@davidpanderson
Copy link
Contributor Author

Also lots of
warning: redundant redeclaration of 'void wxQsort(...
in gcc/Linux

Use snprintf() instead of sprintf() in a few places
(should eventually do it everywhere)

Notes:

(void)x;
seems to work (cross-platform) for suppressing unused arg warnings.

int n;
n = snprintf(buf, sizeof(buf), ....)
(void)n;

works in some cases for suppressing buffer-size warnings.
But not all cases.  Not sure why.
@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Project coverage is 10.85%. Comparing base (b8b95c3) to head (c29a4da).
Report is 1127 commits behind head on master.

Files with missing lines Patch % Lines
tools/create_work.cpp 0.00% 8 Missing ⚠️
tools/backend_lib.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #5163   +/-   ##
=========================================
  Coverage     10.85%   10.85%           
  Complexity     1064     1064           
=========================================
  Files           279      279           
  Lines         35992    35992           
  Branches       8258     8258           
=========================================
  Hits           3907     3907           
  Misses        31693    31693           
  Partials        392      392           
Files with missing lines Coverage Δ
api/boinc_api.cpp 0.00% <ø> (ø)
lib/boinc_stdio.h 12.00% <ø> (ø)
tools/backend_lib.cpp 0.00% <0.00%> (ø)
tools/create_work.cpp 0.00% <0.00%> (ø)

@davidpanderson
Copy link
Contributor Author

I think I'm done with this PR.

@AenBleidd
Copy link
Member

I'll review it.

Copy link
Member

@AenBleidd AenBleidd left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thank you for this PR

@AenBleidd AenBleidd merged commit 4db1c2b into master Mar 23, 2023
@AenBleidd AenBleidd deleted the dpa_win_cleanup2 branch August 15, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants