* Removing all MSVC C4127 warning suppression pragmas.
* Removing MSVC /WX (WERROR). To get a full list of all warnings.
* Inserting PYBIND11_SILENCE_MSVC_C4127. Changing one runtime if to #if.
* Changing PYBIND11_SILENCE_MSVC_C4127 macro to use absolute namespace (for use outside pybind11 include directory).
* Restoring MSVC /WX (WERROR).
* Removing globally-scoped suppression for clang -Wunsequenced. Based on an experiment under PR #3202 it is obsolete and can simply be removed.
* Removing all pragma from eigen.h
* Removing -Werror or equivalent from tests/CMakeLists.txt
* Restoring tests/CMakeLists.txt from master.
* Adding 4 PYBIND11_SILENCE_MSVC_C4127.
* Compatibility with -Wconversion, -Wdeprecated
* Introducing PYBIND11_COMPATIBILITY_WDEPRECATED_COPY
* Systematically using --verbose for compilations where possible (cmake 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.
* Commenting out pragmas as an experiment to reproduce previous observation.
* Removing all (newly added, but already commented-out) pragma code, adding HINT use -isystem (as cmake does).
* Restoring ci.yml from master. Those changes are better handled separately. 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).
* Fix errant const methods
* Remove NOLINT since clang-tidy is pretty conservative
* Missed one
* Fix a few more errors
* Add reviewer suggested comments
* Run clang-format
The only manual intervention was to remove the merge conflict markers in pybind11.h.
TODO in separate commit: complete removal of the obsolete detail/pragma_warning_block.h.
* Removing last remnants of pragma block at the top of pybind11.h, defaulting CUDA, GCC7, GCC8 to PYBIND11_NOINLINE_DISABLED, with the option to define PYBIND11_NOINLINE_FORCED.
* Unique SOSIZE prefix to make it easier to extract the sosizes from the GitHub logs.
* Commenting out PYBIND11_WERROR block, for noinline testing.
* Undoing accidental change.
* `#define PYBIND11_NOINLINE_FORCED`
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* `#define PYBIND11_NOINLINE_DISABLED`
* Going back to default (removing `#define PYBIND11_NOINLINE_DISABLED`).
* `#define PYBIND11_NOINLINE_FORCED`
* Undoing all changes releated to measuring sosizes.
* Rollback of PR #3030 (Working around Centos 8 failure).
* Disabling -Werror for GNU (experiment).
* Commenting out the entire `if(PYBIND11_WERROR)` again (although that is not expected to make a difference, but who knows what I am overlooking).
* Adding `-DCMAKE_BUILD_TYPE=Release`
* Undoing change to tests/CMakeLists.txt (uncommenting `if(PYBIND11_WERROR)` block).
* post `git rebase master -X theirs` fixups.
* Adding measurements to comment for `PYBIND11_NOINLINE_FORCED`.
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Apply isort
* Tweak isort config
* Add env.py as a known_first_party
* Add one missing known first party
* Make config compat with older isort versions
* Add another comment
* Revert pyproject setting
* Removing pragma for GCC -Wattributes, fixing forward declarations.
* Introducing PYBIND11_NOINLINE_FWD to deal with CUDA, GCC7, GCC8.
* Updating PYBIND11_NOINLINE_DCL in Doxyfile.
* Trying noinline, noinline for {CUDA, GCC7, GCC8}
* Trying noinline, inline for {CUDA, GCC7, GCC8}
* Adding GCC -Wattributes `pragma` in 3 header files.
* Introducing PYBIND11_NOINLINE_GCC_PRAGMA_ATTRIBUTES_NEEDED, used in 9 header files.
* Removing ICC pragma 2196, to see if it is still needed.
* Trying noinline, noinline for ICC
* Trying noinline, inline for ICC
* Restoring ICC pragma 2196, introducing PYBIND11_NOINLINE_FORCED, defined for testing.
* Removing code accidentally left in (was for experimentation only).
* Removing one-time-test define.
* Removing PYBIND11_NOINLINE_FWD macro (after learning that it makes no sense).
* Testing with PYBIND11_NOINLINE_DISABLED. Minor non-functional enhancements.
* Removing #define PYBIND11_NOINLINE_DISABLED (test was successful).
* Removing PYBIND11_NOINLINE_FORCED and enhancing comments for PYBIND11_NOINLINE.
* WIP stripping back
* Making -Wattributes pragma in pybind11 specific to GCC7, GCC8, CUDA.
* test_eval: Show example of working closure
* Extend test_eval_closure with weirder examples of closures for py::eval
Co-authored-by: Yannick Jadoul <yannick.jadoul@belgacom.net>
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
* Cleanup triggered by work on pragma for GCC -Wunused-but-set-parameter.
* Backing out changes to eigen.h (to be worked on later).
* Adding PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER in type_caster_base.h (apparently needed only for older GCCs).
* Apparently older compilers need a simpler overload for silence_unused_warnings().
* clang C++11 compatibility: removing constexpr
* Special case for MSVC 2017: `constexpr void` return
* Trying again without the silence_unused_warnings(const int *) overload.
* Separate macros for ALL_GCC, OLD_GCC_UNUSED_BUT_SET_PARAMETER
* Changing to __GNUC__ <= 2 (turning off)
* Refined condition for PYBIND11_WORKAROUND_INCORRECT_OLD_GCC_UNUSED_BUT_SET_PARAMETER.
* Quick experiment trying out suggestion by @henryiii
* Introducing macro: PYBIND11_INT_ARRAY_WORKING_AROUND_MSVC_CLANG_ISSUES
* Trying henryiii@ (void) expander idea.
* fix: apply simpler expression with fewer workarounds
* Purging new-but-already-obsoleted macro, made possible by @henryiii's commit.
* Renaming `ALL_GCC` macro back to just `GCC` (because there is no `OLD` anymore, luckily).
* [actions skip] Adding "All GCC versions" to comment, to be clear about it.
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
* Removing pragma for 4127 (to see what is still broken with the latest code).
* Using new constexpr_bool() to suppress warning C4127.
* One missed case, Python 2 only.
* PYBIND11_SILENCE_MSVC_C4127 (more similar to the approach for C4100).
* Moving pragma for C4505 from pybind11.h to existing list in detail/common.h.
* Removing 4 existing suppressions to 1. see what is still needed and 2. capture the MSVC messages.
* It turns out none of the 4 pragmas are needed anymore.
* mingw64 platform string is like mingw_xxx not "mingw"
See https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-python/0099-Change-the-get_platform-method-in-sysconfig-and-dist.patch
* Mingw: Do not dllexport exceptions
This is a fix for errors like:
D:/a/pybind11/pybind11/include/pybind11/detail/common.h:735:23: error: 'dllexport' implies default visibility, but 'class pybind11::builtin_exception' has already been declared with a different visibility
735 | class PYBIND11_EXPORT builtin_exception : public std::runtime_error {
| ^~~~~~~~~~~~~~~~~
* GHA: Test Mingw64 build
* fix: avoid thin binaries on mingw
* fix: drop lto on MinGW
* Mingw64: disable PYBIND11_DEPRECATED
It trigger many warnings for unknown reasons
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
* Moving pragma for ignoring -Wnoexcept-type to the one location where it is needed.
* Trying a second location.
* The previous commit worked (GitHub Actions green), but see the added comment about the dicy nature of -Wnoexcept-type ("if and only if").
* Applying reviewer suggestion.
* Removing pragma for 4100 (to see what is still broken with the latest code).
* Adding --keep-going
* Revert "Adding --keep-going"
This reverts commit 1c844c6ffd07a6111b644811e7e3b0a50b9d44bb.
* Introducing PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100.
* _MSC_VER <= 1916
* Replacing simple variadic function with variadic template (attempt to resolve MSVC 2017 failures).
* Preserving existing comment (moved from pybind11.h to detail/common.h).
* Adding blank lines for readability.
* Fixing `pragma warning pop` for `__INTEL_COMPILER`.
* Adding push/pop to 3 tests. Removing #878 from top of pybind11.h (it was/is only needed for 1 test).
* Trying again after CI failure, moving the push to the top of 2 tests.
* Trying more after CI failure, adding push/pop to pybind11_tests.h, constructor_stats.h.
* Moving ICC #2196 suppression to CMakeLists.txt
* Fixing condition for `pragma GCC diagnostic push` in pybind11.h
* Moving `pragma warning disable 2196` to common.h
* Revising #ifdef to be more conservative.
* Undoing insertion of notes that will hopefully soon be completely obsolete anyway.
* maint(clang-tidy) Improve code readability
* Fix minor typos
* Revert optimization that removed test case
* Fix comment formatting
* Revert another optimization to repro an issue
* Remove make_unique since it C++14 and newer only
* eformat comments
* Fix unsignedness of comparison
* Update comment