Bug 1901

Summary: Wrong configure result for -Wno-unused-result and gcc-4.4
Product: Portable OpenSSH Reporter: Gilles Espinasse <g.esp>
Component: Build systemAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: minor CC: djm
Priority: P2    
Version: 5.8p2   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 1845    
Attachments:
Description Flags
/home/djm/bz1901.diff dtucker: ok+

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