Useless checks in accessor functions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KiCad |
Fix Released
|
Low
|
Jeff Young |
Bug Description
The functions
- FP_LIB_TABLE* PROJECT:
- FP_LIB_TABLE* PROJECT:
- SYMBOL_LIB_TABLE* PROJECT:
- PART_LIBS* PROJECT::SchLibs()
use dynamic_cast<> to verify that the object they received from GetElem() is of the requested type. As they perform the cast on a pointer that has already been coerced to the target type, the cast is a no-op and the check optimized out.
Enabling the test introduces undefined symbols during linking for tools not linking against pcbcommon.a, as the typeinfo for FP_LIB_TABLE is now required from project.o in common.lib, while it is provided in fp_lib_table.o, so this would pull the entire new IO framework into common.a.
The attached patch activates the test, which causes the linker error mentioned, so it is incomplete.
Changed in kicad: | |
status: | Fix Committed → Fix Released |
@Simon-
I'm not sure what this report is. Are you saying that the patch introduces an error that didn't exist before?
My apologies but I'm not fully understanding this.