From 02fca8e0df2f43dd56dec3f17ed9b6fff9347602 Mon Sep 17 00:00:00 2001 From: John Beard Date: Thu, 18 Apr 2019 14:59:11 +0100 Subject: [PATCH] Pcbnew: fix -Wmaybe-uninitialized in legacy PCB plugin In the failure case, the "makeType" is uninitialised. In a non-debug build, wxFAIL will compile out and the uninitialised behaviour will happen silently. In a debug build, it'll assert, and then do the uninitialised behaviour anyway. Continue explicity to avoid this. --- pcbnew/legacy_plugin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index d032e70096..10cb3b70bf 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -2308,11 +2308,18 @@ void LEGACY_PLUGIN::loadTrackList( int aStructType ) flags = static_cast( flags_int ); if( aStructType == PCB_TRACE_T ) + { makeType = ( type == 1 ) ? PCB_VIA_T : PCB_TRACE_T; + } else if (aStructType == NOT_USED ) + { continue; + } else + { wxFAIL_MSG( "Segment type unknown" ); + continue; + } TRACK* newTrack;