Scott: I agree this option is useful. If all package owners agree to clean up their packages, I think we can add it as the default option. For MdeModulePkg and SecurityPkg, I will provide the patch to fix them.
Thanks Liming -----Original Message----- From: Scott Duplichan [mailto:[email protected]] Sent: Monday, October 06, 2014 12:49 PM To: [email protected] Subject: [edk2] BaseTools: Enable gcc -Wunused-but-set-variable for IA32 and X64 builds Recent gcc releases have a useful warning for finding variables that are set but never used: -Wunused-but-set-variable. While ASSERT and other debug macros make this warning unsuitable for an EDK2 release build, the warning seems usable for debug builds. The ARM builds leave this warning enabled for debug builds, but the x86 builds disable it. Why is that? Enabling this warning for gcc x86 debug builds would require fixing a few cases of unused buy set variables, but not too many (see below). Even if there are a couple of cases of false positives, they could be worked around. Thanks, Scott edk2\AppPkg\Applications\Sockets\GetHostByDns\GetHostByDns.c:46:7: warning: variable 'AppStatus' set but not used edk2\AppPkg\Applications\Sockets\GetHostByName\GetHostByName.c:44:7: warning: variable 'AppStatus' set but not used edk2\AppPkg\Applications\Sockets\GetNetByName\GetNetByName.c:44:7: warning: variable 'AppStatus' set but not used edk2\AppPkg\Applications\Sockets\GetServByName\GetServByName.c:44:7: warning: variable 'AppStatus' set but not used edk2\AppPkg\Applications\Sockets\GetServByPort\GetServByPort.c:45:7: warning: variable 'AppStatus' set but not used edk2\MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.c:187:25: warning: variable 'PrimaryBusNumber' set but not used edk2\OptionRomPkg\Library\FrameBufferBltLib\FrameBufferBltLib.c:239:36: warning: variable 'BltMemSrc' set but not used edk2\OvmfPkg\Library\QemuFwCfgLib\QemuFwCfgLib.c:280:12: warning: variable 'FileReserved' set but not used edk2\SecurityPkg\VariableAuthenticated\RuntimeDxe\AuthService.c:2135:37: warning: variable 'WrapSigData' set but not used edk2\SecurityPkg\VariableAuthenticated\SecureBootConfigDxe\SecureBootConfigFileExplorer.c:655:29: warning: variable 'NoLoadFileHandles' set but not used edk2\StdLib\BsdSocketLib\bind.c:54:14: warning: variable 'Status' set but not used edk2\StdLib\BsdSocketLib\getnameinfo.c:414:15: warning: variable 'ifindex' set but not used edk2\StdLib\BsdSocketLib\getnameinfo.c:415:25: warning: variable 'a6' set but not used edk2\StdLib\BsdSocketLib\getsockopt.c:47:14: warning: variable 'Status' set but not used edk2\StdLib\BsdSocketLib\listen.c:48:14: warning: variable 'Status' set but not used edk2\StdLib\BsdSocketLib\poll.c:37:14: warning: variable 'Status' set but not used edk2\StdLib\BsdSocketLib\res_comp.c:171:9: warning: variable 'ppch' set but not used edk2\StdLib\BsdSocketLib\res_mkupdate.c:103:18: warning: variable 'sp1' set but not used edk2\StdLib\BsdSocketLib\res_update.c:123:15: warning: variable 'ttl' set but not used edk2\StdLib\BsdSocketLib\setsockopt.c:46:14: warning: variable 'Status' set but not used edk2\StdLib\EfiSocketLib\Ip4.c:245:13: warning: variable 'LengthInBytes' set but not used edk2\StdLib\EfiSocketLib\Ip4.c:246:11: warning: variable 'pOptionData' set but not used edk2\StdLib\EfiSocketLib\Ip4.c:656:14: warning: variable 'pPort' set but not used edk2\StdLib\EfiSocketLib\Socket.c:4104:14: warning: variable 'Status' set but not used edk2\StdLib\EfiSocketLib\Tcp4.c:1927:22: warning: variable 'pTcp4' set but not used edk2\StdLib\EfiSocketLib\Tcp4.c:843:15: warning: variable 'pLayer' set but not used edk2\StdLib\EfiSocketLib\Tcp6.c:1996:22: warning: variable 'pTcp6' set but not used edk2\StdLib\EfiSocketLib\Tcp6.c:874:15: warning: variable 'pLayer' set but not used edk2\StdLib\LibC\Containers\Queues\Fifo.c:281:17: warning: variable 'SizeOfElement' set but not used edk2\StdLib\LibC\Uefi\InteractiveIO\IIOutilities.c:78:21: warning: variable 'Status' set but not used edk2\StdLib\LibC\Uefi\InteractiveIO\IIOutilities.c:80:21: warning: variable 'RetVal' set but not used edk2\StdLib\LibC\Uefi\InteractiveIO\IIOwrite.c:66:23: warning: variable 'AdjRow' set but not used edk2\StdLib\LibC\Uefi\InteractiveIO\NonCanonRead.c:40:19: warning: variable 'Status' set but not used edk2\StdLib\LibC\Uefi\writev.c:104:21: warning: variable 'pBufTmp' set but not used ------------------------------------------------------------------------------ Slashdot TV. Videos for Nerds. Stuff that Matters. http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
