Bug 1901 - Wrong configure result for -Wno-unused-result and gcc-4.4
Summary: Wrong configure result for -Wno-unused-result and gcc-4.4
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: 5.8p2
Hardware: All All
: P2 minor
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_5_9
  Show dependency treegraph
 
Reported: 2011-05-06 20:46 AEST by Gilles Espinasse
Modified: 2011-09-06 15:32 AEST (History)
1 user (show)

See Also:


Attachments
/home/djm/bz1901.diff (2.79 KB, patch)
2011-05-20 10:32 AEST, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gilles Espinasse 2011-05-06 20:46:45 AEST
Since gcc-4.4, gcc will happily accept -Wno-<anything> for the reason explained in http://gcc.gnu.org/PR28322

openssh configure test for -Wno-unused-result that is not know by gcc-4.4 (only on gcc-4.5) but test did not fail.

Each time another warning is emitted (like 
ignoring return value of 'write', declared with attribute warn_unused_result ), on gcc-4.4 usage of -Wno-unused-result add this warning
cc1: warning: unrecognized command line option "-Wno-unused-result"

This happen 9 times in openssh-5.8p2

The solution is to test if -Wunused-result is supported and in that case only -Wno-unused-result could be used.

This is trivial for me to add -Wunused-result detection in configure.ac.

But I don't know yet how to adapt that. When -Wunused-result is detected to be supported, I don't know how the no- option only could be added to supported flags.
Comment 1 Damien Miller 2011-05-20 10:32:48 AEST
Created attachment 2047 [details]
/home/djm/bz1901.diff

check for -Woption, but set -Wno-option
Comment 2 Damien Miller 2011-05-20 11:43:45 AEST
Fixed - thanks.
Comment 3 Damien Miller 2011-09-06 15:32:58 AEST
close resolved bugs now that openssh-5.9 has been released