Windows/Debug builds cause runtime asserts
libtheora uses a pattern of type var=var;
to suppress GCC "use before uninitialized" warnings. Unfortunately, this causes assertions about reads of uninitialized memory with MSVC in debug mode (in particular, the /RTCu
flag (MSDN docs). These should be handled somehow.
Upstream doesn't seem to want to deal with it properly (thread start) and doing #ifdef
around all instances is unmaintainable (new ones which may appear are just land mines waiting to happen), so flag manipulation is probably best.
To find instances of this pattern in the codebase, this grep
expression may be used:
grep -E ' (\<\S+\>)\s*=\s*\<\1\>;' lib/*.c
As of this issue, the for/vtk
branch has these instances:
lib/analyze.c: int sb_full=sb_full;
lib/analyze.c: int sb_full=sb_full;
lib/tokenize.c: int best_bits=best_bits;
lib/tokenize.c: int best_next=best_next;
lib/tokenize.c: int best_token=best_token;
lib/tokenize.c: int best_eb=best_eb;
lib/tokenize.c: int best_qc=best_qc;
lib/tokenize.c: int token1=token1;
lib/tokenize.c: int eb1=eb1;
lib/tokenize.c: ptrdiff_t ti=ti;