This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add check_result attribute
- From: DJ Delorie <dj at redhat dot com>
- To: apinski at apple dot com
- Cc: jakub at redhat dot com, apinski at apple dot com, rth at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Fri, 12 Sep 2003 16:43:21 -0400
- Subject: Re: [PATCH] Add check_result attribute
- References: <2A579122-E561-11D7-A58D-0003939F15BE@apple.com>
> Coming as I do from a Lisp background, I balk at the idea that there is
> something dangerous about discarding a value. There are functions that
> return values which some callers may find useful; it makes no sense to
> clutter the program with a cast to void whenever the value isn't useful.
However, as an application programmer, I can attest that there are
times when policy requires that return values always be checked
properly - with exceptions duly noted and commented. Being able to
explicitly tag such functions and forbid discarding their return
values would be a useful extension to have.