Reitter: Answering the question: "How do I develop an app for GNOME?"
Posted Feb 6, 2013 21:58 UTC (Wed) by mpr22 (subscriber, #60784)
Posted Feb 8, 2013 14:51 UTC (Fri) by jwakely (guest, #60262)
What's GCC's option for that?
You can use __attribute__((warn_unused_result)) but putting that on every function returning non-void is hardly practical, let alone portable.
Posted Feb 12, 2013 19:51 UTC (Tue) by mgedmin (subscriber, #34497)
Posted Feb 12, 2013 20:21 UTC (Tue) by nybble41 (subscriber, #55106)
Posted Feb 12, 2013 21:03 UTC (Tue) by mpr22 (subscriber, #60784)
Posted Feb 12, 2013 22:56 UTC (Tue) by Cyberax (✭ supporter ✭, #52523)
Nope. Apart from maybe printf() - most of the error checking is necessary for secure code.
It just shows that exception handling is really much better than return codes when you want something that's reliable _and_ easy to read.
Posted Feb 12, 2013 21:04 UTC (Tue) by zlynx (subscriber, #2285)
Warnings about unused results are also common in code analysers like Splint and others.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds