summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wunused-value-2.c
blob: 4858bfade72f389699b6a8b565ea1afdb7d0c333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* Test -Wunused-value.  Bug 30729.  */
/* { dg-do compile } */
/* { dg-options "-Wunused-value" } */
/* Make sure va_arg does not cause a value computed is not used warning
   because it has side effects.   */
#include <stdarg.h>

int f(int t, ...)
{
  va_list a;
  va_start (a, t);
  va_arg(a, int);/* { dg-bogus "value computed is not used" } */
  int t1 = va_arg(a, int);
  va_end(a);
  return t1;
}