Problem
The bundled dxflib code emits -Wuninitialized / -Wmaybe-uninitialized warnings when compiled with -Wall:
dl_entities.h:1539:22: error: '<anonymous>.DL_HatchEdgeData::type' is used uninitialized [-Werror=uninitialized]
1539 | struct DXFLIB_EXPORT DL_HatchEdgeData {
Triggered at dl_dxf.cpp:606 and dl_dxf.cpp:2018 where hatchEdge = DL_HatchEdgeData() default-constructs the struct. GCC flags the implicit move-assignment of uninitialized members as a potential use-before-init, even though the struct is being reset (not read).
This is a false positive in GCC's analysis — the default constructor value-initializes all members — but it fires reliably with -O3 inlining.
Current workaround
PR #369 suppresses -Wno-uninitialized and -Wno-maybe-uninitialized on the bundled dxflib source files via set_source_files_properties. This keeps -Werror working for gerbv's own code.
Upstream fix
The proper fix is in dxflib itself (QCAD): either adding a user-defined default constructor to DL_HatchEdgeData that explicitly initializes all members, or using = {} member initializers. This should be reported to https://github.com/qcad/qcad.
Problem
The bundled dxflib code emits
-Wuninitialized/-Wmaybe-uninitializedwarnings when compiled with-Wall:Triggered at
dl_dxf.cpp:606anddl_dxf.cpp:2018wherehatchEdge = DL_HatchEdgeData()default-constructs the struct. GCC flags the implicit move-assignment of uninitialized members as a potential use-before-init, even though the struct is being reset (not read).This is a false positive in GCC's analysis — the default constructor value-initializes all members — but it fires reliably with
-O3inlining.Current workaround
PR #369 suppresses
-Wno-uninitializedand-Wno-maybe-uninitializedon the bundled dxflib source files viaset_source_files_properties. This keeps-Werrorworking for gerbv's own code.Upstream fix
The proper fix is in dxflib itself (QCAD): either adding a user-defined default constructor to
DL_HatchEdgeDatathat explicitly initializes all members, or using= {}member initializers. This should be reported to https://github.com/qcad/qcad.