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 warnings caught by gcc's -Wuseless-cast option #133

Closed
wants to merge 1 commit into from

Conversation

christosg88
Copy link

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:
  • CPU: 12th Gen Intel(R) Core(TM) i5-1240P
  • architecture: x86_64
  • num cores: 12
  • num threads: 24
  • OS: Ubuntu 23.10
  • compiler: gcc-13.2.0
  • cmd: g++ BS_thread_pool_test.cpp -I../include -std=c++17 -O3 -Wall -Wextra -Wconversion -Wsign-conversion -Wpedantic -Weffc++ -Wshadow -Wuseless-cast -pthread -o BS_thread_pool_test

Additional information

Include any additional information here.

None

@bshoshany
Copy link
Owner

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.

@bshoshany bshoshany closed this Dec 28, 2023
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.

2 participants