facebook / facebook/zstd

Disabled assert() could use its argument to avoid unused variable warnings

Open
#2,868 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
27.9k
Forks
2.6k
Avg merge
1d 3h
Merged PRs (30d)
8

Description

Test this construction for disabling assertions:

```c
#define assert(condition) \
do { \
if (0) { \
(void)(condition); \
} \
} while (0)
```

Additionally, do the same for `RAWLOG()` and `DEBUGLOG()` when `DEBUGLEVEL < 2`.

This would avoid unused variable warnings that show up in production.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.