bshoshany / thread-pool

BS::thread_pool: a fast, lightweight, and easy-to-use C++17 thread pool library
MIT License
2.21k stars 253 forks source link

Fix warnings caught by gcc's -Wuseless-cast option #133

Closed cgkantidis closed 10 months ago

cgkantidis commented 10 months ago

Pull request policy (please read)

Contributions are always welcome. However, I release my projects in cumulative updates after editing and testing them locally on my system, so my policy is not to accept any pull requests. If you open a pull request, and I decide to incorporate your suggestion into the project, I will first modify your code to comply with the project's coding conventions (formatting, syntax, naming, comments, programming practices, etc.), and perform some tests to ensure that the change doesn't break anything. I will then merge it into the next release of the project, possibly together with some other changes. The new release will also include a note in CHANGELOG.md with a link to your pull request, and modifications to the documentation in README.md as needed.

Describe the changes

What does your pull request fix or add to the library?

This pull request removes some useless static casts from type size_t to type size_t, and adds the warning specification to the README.md.

Style

Have you formatted your code using the .clang-format file attached to this project?

Yes.

Linting

Have you linted your code using the .clang-tidy file attached to this project?

Yes

Testing

Have you tested the new code using the provided automated test program BS_thread_pool_test.cpp (preferably with the provided multi-compiler test script BS_thread_pool_test.ps1) and/or performed any other tests to ensure that the new code works correctly? If so, please provide information about the test system(s):

  • CPU model, architecture, # of cores and threads:
  • Operating system:
  • Name and version of C++ compiler:
  • Full command used for compiling, including all compiler flags:

Additional information

Include any additional information here.

None

bshoshany commented 10 months ago

Hi @christosg88 and thanks for the PR! I will remove the redundant casts in the next release (either 4.0.1 or 4.1.0, depending how many changes it will have). Not sure about adding -Wuseless-cast to README.md though, since Clang doesn't support it, and the compilation instructions become a bit verbose. I will probably add it to the test script, though.