Fixes 1 Technical Debt and 3 Compiler Warnings #2213

Open
opened 2026-04-06 01:48:26 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @rubienr on 9/13/2025

Description

This PR

  • Fixes #10652
  • Fixes 3 compiler Warnings and 1 Technical Debt:
    1. fixes: memcpy(...) writing to an object of type OrientParams with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess] 🐟
    2. fixes: SetSashSize() is deprecated [-Wdeprecated-declarations]; doesn't do anything and shouldn't be used
    3. fixes: wxPlatformInfo::GetArchName() is deprecated: Use GetBitnessName() instead [-Wdeprecated-declarations]

Regarding i.) 🐟 memcpy(...)[-Wclass-memaccess]:

The authors intention was to crate a new type OrientParamsArea holding a different parameter-set other than OrientParams default values to be later assigned to OrientParams. In the program flow it was "assigned" by memcpy(orient_params, orient_params_area, sizeof(orient_params)). Both types were incompatible; had no common base - just same members.

First attempt to introduce a const static OrientParams holding the parameter set of OrientParamsArea that could be operator= assigned, failed due to old M$VC compiler /std in pipeline: error C7555: use of designated initializers requires at least '/std:c++20'

The fix removes the incompatible, redundant type OrientParamsArea and moves the parameter-set to a void setMinimalSupportAreaPrams(Slic3r::orientation::OrientParams &out) function.

In short: instead of
memcpy(&params_type, &incompatible_params_area_type, sizeof(params_type));
it updates to
setMinimalSupportAreaPrams(params_type);

*Originally created by @rubienr on 9/13/2025* # Description This PR - Fixes #10652 - Fixes 3 compiler Warnings and 1 Technical Debt: 1. fixes: memcpy(...) writing to an object of type OrientParams with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess] :fish: 1. fixes: SetSashSize() is deprecated [-Wdeprecated-declarations]; doesn't do anything and shouldn't be used 1. fixes: wxPlatformInfo::GetArchName() is deprecated: Use GetBitnessName() instead [-Wdeprecated-declarations] **Regarding i.) :fish: `memcpy(...)[-Wclass-memaccess]`:** The authors intention was to crate a new type `OrientParamsArea` holding a different parameter-set other than `OrientParams` default values to be later assigned to `OrientParams`. In the program flow it was "assigned" by `memcpy(orient_params, orient_params_area, sizeof(orient_params))`. Both types were incompatible; had no common base - just same members. First attempt to introduce a `const static OrientParams` holding the parameter set of `OrientParamsArea` that could be `operator=` assigned, failed due to old M$VC compiler `/std` in pipeline: `error C7555: use of designated initializers requires at least '/std:c++20'` The fix removes the incompatible, redundant type `OrientParamsArea` and moves the parameter-set to a `void setMinimalSupportAreaPrams(Slic3r::orientation::OrientParams &out)` function. In short: instead of `memcpy(&params_type, &incompatible_params_area_type, sizeof(params_type));` it updates to `setMinimalSupportAreaPrams(params_type);`
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#2213