Re: IDE/ Command Line - failing on ignored return value
Re: IDE/ Command Line - failing on ignored return value
- Subject: Re: IDE/ Command Line - failing on ignored return value
- From: glenn andreas <email@hidden>
- Date: Thu, 4 May 2006 10:24:10 -0500
On May 4, 2006, at 9:59 AM, Tommy Nordgren wrote:
Is there any command line option/ IDE setting that can be used to
fail the build,
or at least give a warning if return values are ignored in C++ and C?
Are you really sure you want such a thing? Are you, for example,
using the return values from all of your printfs? strcat/strcpys?
memsets? fclose?
Basically almost all of the standard C library routines return a
value - making sure to not ignore them would, at best, needlessly
clutter your app (or alternately, flood your build log with "false
positive" warning messages, obscuring any useful ones).
(I vaguely seem to remember it is because of this that such a warning
does not exist, but that's one of those "back in the distant past"
memories)
For specific cases, however, I believe you can do something like:
void* foo(int param1, int param2) __attribute__
((__warn_unused_result__));
and thus indicate that this specific routine's return value should
not be ignored (as opposed to checking all of them)
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | build, mutate, evolve | images, textures, backgrounds, art
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden