launchdarkly / c-client-sdk

LaunchDarkly Client-side SDK for C/C++
Other
7 stars 15 forks source link

FIx maybe-uninitialized variables #67

Closed camarois closed 2 years ago

camarois commented 2 years ago

Describe the bug When running cmake with -Werror, I get -Werror=maybe-uninitialized at a couple of places in client.c and event_processor.c.

Expected behavior That these variables be initialized.

Logs This is my diff file fixing the uninitialized variables.

diff --git a/src/client.c b/src/client.c index 442d486..21de277 100644 --- a/src/client.c +++ b/src/client.c @@ -956,7 +956,7 @@ LDStringVariationDetail( LDVariationDetails *const details) { size_t resultLength;

SDK version 2.3.1

OS/platform Ubuntu 20.04

kinyoklion commented 2 years ago

Hi @camarois.

Thank you for reporting this.

Are you using clang or gcc, and could you provide the versions? Or let me know if you are using the defaults from the build-essential.

Filed internally as 128184.

camarois commented 2 years ago

It's gcc 9.3.0.

camarois commented 2 years ago

Hi @kinyoklion , any idea on the ETA for this issue?

kinyoklion commented 2 years ago

Hello @camarois, this issue is in the backlog, but there is not an ETA.

Some additional detail. We include -Wall and -Werror in our default compiler arguments. Interestingly this warning only surfaces with the addition of -O3, and dropping down to -O2 and it goes away.

cwaldren-ld commented 2 years ago

Hi @camarois, thank you for your patience! This issue has been resolved in release 2.4.3. Please do let us know if you are still having issues.