Skip to content

Commit

Permalink
stdarg: use sysv varargs when we build with coverity
Browse files Browse the repository at this point in the history
cov-analysis-linux64-2020.09 is a lot more successful than the older
versions at building, but it still has some... issues.  Among them, it
is of the belief that this:

void
foo(char *fmt, ...)
{
  __builtin_va_list ap;

  __builtin_ms_va_start(ap, fmt); /* <- here */
  ...
}

is an uninitialized use of "ap".

This patch adds defined(__COVERITY__) to the list of criteria for using
sysv va lists, which it has no such confusion about.

Signed-off-by: Peter Jones <[email protected]>
  • Loading branch information
vathpela committed Dec 10, 2021
1 parent 0dd4c78 commit 2e78cd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/system/stdarg.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ typedef __builtin_va_list __builtin_sysv_va_list;
#endif

#if defined(__aarch64__) || defined(__arm__) || defined(__i386__) || \
defined(__i486__) || defined(__i686__)
defined(__i486__) || defined(__i686__) || defined(__COVERITY__)

typedef __builtin_va_list ms_va_list;
typedef __builtin_va_list __builtin_ms_va_list;
Expand Down

0 comments on commit 2e78cd9

Please sign in to comment.