Public bug reported:

Here is a sample program,

printf "#include <sys/uio.h>\nvoid foo(void) {\n (void)writev(1,
(void*)0, 0);\n }\n" | gcc -Wall -Wformat=2 -Wshadow -O1 -c -xc - -o
foo.o

If you change to '-O0', there is no warning.  I have  x86_64 but I doubt
that matters?  The issue is to have the warnings, but ignore by casting
the result for that particular case (next statement is abort()).

The same things happens in 4.8, 4.9, and version 5.  Maybe this is
desired?

** Affects: gcc-7 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1837329

Title:
  C unsed results warning when optiming

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-7/+bug/1837329/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to