From 543b783d5644b64be6b1baef3c9bd2370d54392c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20G=C3=A9czi?= Date: Mon, 23 Dec 2024 00:00:00 +0000 Subject: [PATCH] [generator] Suppress false positive `may be used uninitialized` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following gcc warning is only emitted when `cmake` has been invoked with `-DCMAKE_CXX_FLAGS='-Og'` for debug purposes. ```` generator/maxspeeds_builder.cpp: In lambda function: generator/maxspeeds_builder.cpp:249:9: warning: ‘status’ may be used uninitialized [-Wmaybe-uninitialized] 249 | if (status == 0) | ^~ generator/maxspeeds_builder.cpp:181:13: note: ‘status’ was declared here 181 | int status; | ^~~~~~ ```` Signed-off-by: Ferenc Géczi --- generator/maxspeeds_builder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/maxspeeds_builder.cpp b/generator/maxspeeds_builder.cpp index c4d05c60ff..d9c50da464 100644 --- a/generator/maxspeeds_builder.cpp +++ b/generator/maxspeeds_builder.cpp @@ -178,7 +178,7 @@ public: return; // 0 - not updated, 1 - goto next iteration, 2 - updated - int status; + int status = 0; HwTypeT const hwType = GetHighwayType(fid);