Re: [Opencxx-users] Checking of return codes

Stefan Seefeld <[email protected]>
Newsgroups gmane.comp.documentation.synopsis
Message-ID <[email protected]>
SF Markus Elfring wrote:
>>In what way to you think a static analysis tool can help ? Synopsis can't guess the domain
>>of all possible values, and so can't know if all values are tested for. In the same
>>line of thought I don't think exceptions are an appropriate means.
> 
> 
> I imagine that it can be looked up from the function declaraction or definition that the return type is not void.
> I would like to enforce that the return value will be checked after the function call so that the result will never be ignored.

That's what I suggested. Checking that the return value is actually used can be done at
compile-time. That doesn't involve any code generation, though. Synopsis could just issue
a message if it finds a function call with a non-void return value that is not used later on.

The hardest part is (again) the required type analysis to do proper overload resolution.
That's not supported by OpenC++ (afaik), and for Synopsis It's still in (early) development.

As usual, any help would be much appreciated !

Regards,
		Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.