Skip to content

Commit

Permalink
Fix clang-analyzer-valist.Uninitialized on Ubuntu
Browse files Browse the repository at this point in the history
error: Function 'vsnprintf' is called with an uninitialized va_list argument

- Silence this warning as the variable will be initialized by the time `vsprintf()` will be called plus it seems that it is not standard in C/C++ to initialize this type before `va_start()`
  • Loading branch information
N1ckP3rsl3y committed Aug 2, 2024
1 parent effdc28 commit fa7d059
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/filefuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ void LogError(LOG_INFO *LogInfo, const int mode, const char *fmt, ...) {
#endif
}

// NOLINTNEXTLINE(clang-analyzer-valist.Uninitialized)
expectedWriteSize = vsnprintf(buf, MAX_LOG_SIZE, outfmt, args);
#ifdef SWDEBUG
if (expectedWriteSize > MAX_LOG_SIZE) {
Expand Down

0 comments on commit fa7d059

Please sign in to comment.