5
Technical Todo List
Ian McInerney edited this page 2023-03-10 16:55:15 +00:00

This list contains various technical items that need to be done/changed in the codebase, but might be blocked from being changed until dependency versions or compiler versions are at a high enough version.

C++ Standard Todo list

C++17

Compiler support:

Provides:

  • OPT<> can be replaced with std::optional. Header core/optional.h can be removed and replaced with the built-in <optional>. Needs GCC 7
  • std::filesystem can replace boost::filesystem.
  • [[fallthrough]] attribute can be used to indicate switch statements intentionally fallthrough. Then Clang -Wimplicit-fallthrough warnings can be enabled and the current logic for KI_FALLTHROUGH can be simplified.
  • Switch the m_param field of TOOL_EVENT from void* to std::any

C++20

Compiler support:

Provides:

  • constexpr std::string and constexpr std::vector can be used to initialize items:
    • File extensions in wildcards_and_files_ext.h

3rd Party Libraries

There are several places in KiCad where workarounds exist for defects in 3rd party library limitations or defects.

Boost

1.59

  • Boost 1.59 brings a major overhaul of the [Boost test][] library.
    • Many "Polyfills" in unit_test_utils.h can be removed:
      • BOOST_TEST_CONTEXT and BOOST_TEST_INFO are available, remove the polyfill macros.
      • boost::unit_test::expected_failures is available, so can remove the HAVE_EXPECTED_FAILURES guard macro.
      • BOOST_TEST_PRINT_NAMESPACE_OPEN doesn't need to switch the namespace

1.64

  • [Boost test][]
    • Boost test print helper for nullptr_t exists, can remove our polyfill
    • The boost_test_print_type customisation point exists and the old code using BOOST_TEST_PRINT_NAMESPACE_OPEN can be converted to use that.

CMake

3.1

3.3

  • Can remove check for CMake policy CMP0063 entirely (the policy exists as of v3.3 and the default is correct).

3.5

  • Can use target_link_libraries(foo Boost::boost) for Boost header-only libraries, rather than ${Boost_INCLUDE_DIRS}. C.f. Github commit

OpenSSL

1.1.0

  • Can remove all locking code from kicad_curl.cpp. From v1.1.0, this is no longer required. C.f. OpenSSL issue 1260

wxWidgets

3.1

This is a development release, but it brings its own set of features and fixes. Most of these will not be available in general distributions until v3.2.

  • DPI scaling on GTK+ available (also needs GTK+ 3.10). C.f. this commit dpi_scaling.cpp should continue to work normally, but the config should no longer be required and the scaling should auto-detect.
  • Once the minimum version is greater than 3.1.3, the code inside the constructor of the HIDPI_GL_CANVAS should be removed, since the default behavior of a wxGLCanvas was changed in 3.1.3 to always want the best resolution.