sergey-dryabzhinsky / python-zstd

Simple python bindings to Yann Collet ZSTD compression library
BSD 2-Clause "Simplified" License
165 stars 27 forks source link

Suggestion for compilation problems #58

Closed rodrigobmg closed 3 years ago

rodrigobmg commented 3 years ago

Hello,

I noticed an issue when compiling your library using a C compiler. In file python-zstd.c the snippet below will not compile because cctx is not being initialized first.

if (source_size > 0) { //Line 96 dest = PyBytes_AS_STRING(result); ZSTD_CCtx* cctx = ZSTD_createCCtx();

my warkaround to this is as follow:

if (source_size > 0) { ZSTD_CCtx* cctx = 0; dest = PyBytes_AS_STRING(result); cctx = ZSTD_createCCtx();

Thanks for all.

sergey-dryabzhinsky commented 3 years ago

Can you provide you system and compiler info? And how compiler warns about cctx?

sergey-dryabzhinsky commented 3 years ago

Can't find such errors on my system with gcc-9 / clang-12.

No feedback. Closing.