https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97748
Bug ID: 97748
Summary: Preincrement of _Complex gives bogus warning = "value
computed is not used"
Product: gcc
Version: 10.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: antiquarktv at gmail dot com
Target Milestone: ---
The following code, when compiled with -Wall, gives the warning "value computed
is not used". The value is in fact used, thus the warning is bogus.
#include <stdio.h>
#include <complex.h>
int main()
{
double _Complex x = 2.0 + I * 2.0;
++x;
printf("%f,%f\n", creal(x), cimag(x));
}
Output:
gcc -Wall test.c
test.c: In function ‘main’:
test.c:7:2: warning: value computed is not used [-Wunused-value]
7 | ++x;
| ^~~