Change PrintParams struct to define the values of boolean attributes explicitly #673

Open
opened 2026-04-05 16:25:34 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @dmach on 2/21/2026

Description

When a struct contains bool attributes without an explicit default value, the value may become uninitialized.
The PrintParams gets passed as a value in may places (using const & instead is probably the right thing to do, but the fix would be relatively large) and that triggers creating a copy. I'm not sure how the compiler behaves in this case.

This may cause crashes such as:

I haven't tested the change, because OrcaSlicer doesn't compile on my system (the libs are too new),
but I'm confident that this change is generally a move in the right direction and should be merged regardless if it fixes the problem or not.

*Originally created by @dmach on 2/21/2026* # Description When a struct contains `bool` attributes without an explicit default value, the value may become uninitialized. The `PrintParams` gets passed as a value in may places (using `const &` instead is probably the right thing to do, but the fix would be relatively large) and that triggers creating a copy. I'm not sure how the compiler behaves in this case. This may cause crashes such as: - https://github.com/OrcaSlicer/OrcaSlicer/issues/12382 - https://github.com/OrcaSlicer/OrcaSlicer/issues/12250 - https://github.com/OrcaSlicer/OrcaSlicer/issues/12348 - https://github.com/OrcaSlicer/OrcaSlicer/issues/12342 I haven't tested the change, because OrcaSlicer doesn't compile on my system (the libs are too new), but I'm confident that this change is generally a move in the right direction and should be merged regardless if it fixes the problem or not.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#673