#include <stdarg.h> int f(int t, ...) { va_list a; va_start (a, t); va_arg(a, int); int t1 = va_arg(a, int); va_end(a); return t1; }
----- We get a warning on the line which just contains va_arg(a, int); Even though the value is not used, a is still incremented so the result is not unused after all. t.c:7: warning: value computed is not used -- Summary: [4.1/4.2/4.3 Regression] value computed is not used warning with unused result of va_arg Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30729