public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/97748] New: Preincrement of _Complex gives bogus warning = "value computed is not used"
@ 2020-11-06 23:21 antiquarktv at gmail dot com
  2020-11-07  8:30 ` [Bug c/97748] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: antiquarktv at gmail dot com @ 2020-11-06 23:21 UTC (permalink / raw)
  To: gcc-bugs

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;
      |  ^~~

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-20 15:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06 23:21 [Bug c/97748] New: Preincrement of _Complex gives bogus warning = "value computed is not used" antiquarktv at gmail dot com
2020-11-07  8:30 ` [Bug c/97748] " jakub at gcc dot gnu.org
2020-11-07  9:17 ` jakub at gcc dot gnu.org
2020-11-10 14:58 ` cvs-commit at gcc dot gnu.org
2020-11-12 10:06 ` cvs-commit at gcc dot gnu.org
2021-04-20 15:18 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).