Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!iuvax!noose.ecn.purdue.edu!venus.ecn.purdue.edu!giacomet From: giacomet@venus.ecn.purdue.edu (Frederic B Giacometti) Newsgroups: comp.lang.eiffel Subject: trouble with variant assertions Message-ID: <1990Sep29.054436.16582@ecn.purdue.edu> Date: 29 Sep 90 05:44:36 GMT Sender: news@ecn.purdue.edu (USENET news) Organization: Purdue University Engineering Computer Network Lines: 55 I have the 2.2B version on a SunSparc. Has this feature ever been tested before its release ? In some cases, whatever be the integer variable or constant I put, my own trace indicates that an exception for invariant violation is generated when intering the second loop. Does this means that the variant is not initialized to its value and remains zero ? How can this happen ? My feature is: unit: like Current is local i: INTEGER do Result.Create( dim ); from i:= 1 variant c_1: 100 -- you can put `dim' or 100000 the result is the same until dim < i loop Result.set_cell( field_unit, i, i ); io.putint(i); io.new_line; i := i+1 end end; I get: -------------------------------------------------------------------------------- Object Class Routine Nature of exception Effect -------------------------------------------------------------------------------- 1ED764 MATRIX3 unit "c_1": (From MATRIX_SQ) Loop variant violated. Fail -------------------------------------------------------------------------------- when entering the second loop (i=2) It's the most trivial iteration. It works perfectly if I remove the variant. Although similar, some loops work, other don't. I ended up removing all my variants to see that everything was OK. I don't want to be nasty; so far I've been much impressed by most capabilities of the eiffel compiler; but does ISE test its releases uniformly on all machines ? I remember, for the silliest one, encountering a "rabs" fonction from the library which would turn its non-zero negative arguments into zero's. Practically, could ISE post a complete list of the bug reports they have received for each platform for the 2.2 version ? It could save us further troubles and spare us unexpected discoveries. Thanks, Frederic Giacometti School of Industrial Engineering Purdue University