Re: gec catcall warnings, how to read them?

Eric Bezault <ericb-D6Qt/9opevxWk0Htik3J/[email protected]> Fri, 07 Sep 2007 08:00:52 +0200
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
Berend de Boer wrote:
> I'm trying to compile an se project with gec, but get a couple of
> catcall warnings. Some are easy to follow, but others leave me quite
> in the dark. For example these:
> 
>   [CATCALL] class KL_EQUALITY_TESTER [XPLAIN_TYPE] (32,15): type 'XPLAIN_EXTENSION' of actual argument #1 does not conform to type 'XPLAIN_ASSERTION' of formal argument in feature `is_equal' in class 'XPLAIN_ASSERTION'
>   [CATCALL] class KL_EQUALITY_TESTER [XPLAIN_TYPE] (32,15): type 'XPLAIN_TYPE' of actual argument #1 does not conform to type 'XPLAIN_ASSERTION' of formal argument in feature `is_equal' in class 'XPLAIN_ASSERTION'
>   [CATCALL] class KL_EQUALITY_TESTER [XPLAIN_TYPE] (32,15): type 'XPLAIN_ASSERTION' of actual argument #1 does not conform to type 'XPLAIN_EXTENSION' of formal argument in feature `is_equal' in class 'XPLAIN_EXTENSION'
>   [CATCALL] class KL_EQUALITY_TESTER [XPLAIN_TYPE] (32,15): type 'XPLAIN_TYPE' of actual argument #1 does not conform to type 'XPLAIN_EXTENSION' of formal argument in feature `is_equal' in class 'XPLAIN_EXTENSION'
> 
> 
> It seems that one line 32 in KL_EQUALITY_TESTER I have a
> problem. Great, but not too helpful in this case. Do I have to check
> every usages of KL_EQUALITY_TESTER in this project to find where the
> problem could occur?

Most of the time CAT-call errors are the result of the usage
of `is_equal' whose signature is CAT-call error prone. If this
equality tester is the key equality tester of a hash table, I
would suggest doing the following instead of creating your
hash table with `make':

   create ht.make_map (n)
   ht.set_key_equality_tester (my_equality_tester)

where your equality tester will inherit from
KL_EQUALITY_TESTER [XPLAIN_TYPE] but will not use `is_equal'
in its implementation.

> gelint doesn't help.

In fact it does. If you use the --cat option, it will  give you
for each CAT-call error all the paths in the code that lead from
the creation of the involved argument and target to their usage
in the call reported in the error.

-- 
Eric Bezault
mailto:ericb-D6Qt/9opevxWk0Htik3J/[email protected]
http://www.gobosoft.com