Skip to content

Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. #3201

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

Merged
merged 15 commits into from
Aug 19, 2021

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Aug 17, 2021

This PR removes most remaining file-scoped warning suppression pragmas from the pybind11 header files (all MSVC C4127), and one globally-scoped suppression (clang -Wunsequenced). All warning suppressions in the header files are now as narrowly scoped as possible.

To summarize:

  • The only globally-scoped suppression left is a very special case, diagnostic 2196 for Intel in detail/common.h. See comments there.
  • The only file-scoped pragma left is in pybind11.h, and it is specific to GCC 7.
  • All other remaining pragmas are narrowly scoped, and in just 3 files: pybind11.h (2 push/pop, in addition to the one file-scoped), pytypes.h (2 push/pop), detail/common.h (2 push/pop).

@rwgk rwgk changed the title WIP: C4127 pragma cleanup. Removal of all remaining file-scoped and globally-scoped warning suppression pragmas from the pybind11 header files. Aug 17, 2021
@rwgk rwgk changed the title Removal of all remaining file-scoped and globally-scoped warning suppression pragmas from the pybind11 header files. Removal of remaining file-scoped and globally-scoped warning suppression pragmas from the pybind11 header files. Aug 17, 2021
@rwgk rwgk changed the title Removal of remaining file-scoped and globally-scoped warning suppression pragmas from the pybind11 header files. Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. Aug 17, 2021
rwgk added 15 commits August 17, 2021 17:21
… 3.14 or newer).

Also changing all `cmake -t` to `--target`, `-v` to `--verbose`, `check` to `pytest`, for consistency (to make it easier to pin-point all commands of a certain type).

Also removing one `-j 2` for `pytest` in hopes of reducing flakes due to races in test_iostream and in prints from destructors.
…tely. BTW: in the last CI run there was still a test_iostream flake, even without the -j 2 for running the tests (verfied by inspecting the log).
…(for use outside pybind11 include directory).
…n an experiment under PR pybind#3202 it is obsolete and can simply be removed.
@rwgk rwgk marked this pull request as ready for review August 18, 2021 00:38
@rwgk rwgk requested review from Skylion007, wjakob and henryiii and removed request for wjakob August 18, 2021 03:53
@rwgk rwgk merged commit 998d45e into pybind:master Aug 19, 2021
@rwgk rwgk deleted the pragma_c4127 branch August 19, 2021 18:37
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Aug 19, 2021
@rwgk rwgk removed the needs changelog Possibly needs a changelog entry label Aug 19, 2021
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