Skip to content

Commit 877e62d

Browse files
committed
Fix compiler warning (-Wmaybe-uninitialized)
gcc warning: src/lstm/recodebeam.cpp:270:41: warning: ‘current_char’ may be used uninitialized in this function [-Wmaybe-uninitialized] It's a false positive, but setting the variable to 0 satisfies the compiler. Signed-off-by: Stefan Weil <[email protected]>
1 parent 33f6dc2 commit 877e62d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lstm/recodebeam.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void RecodeBeamSearch::ExtractBestPathAsWords(const TBOX& line_box,
197197
DebugUnicharPath(unicharset, second_nodes, unichar_ids, certs, ratings,
198198
xcoords);
199199
}
200-
int current_char;
200+
int current_char = 0;
201201
int timestepEnd = 0;
202202
//if lstm choice mode is required in granularity level 2 it stores the x
203203
//Coordinates of every chosen character to match the alternative choices to it

0 commit comments

Comments
 (0)