[net.lang.c++] A bug in cfront, I think ?

mat@mtx5a.UUCP (m.terribile) (04/03/86)

I believe that I have found a bug in cfront.

One line of the program below produces a warning that h is used before set.
(The line is noted.)  When the call to the function h.lm() is removed, the
warning disappears.  Note that I did not gut the expression, I replaced
	h.lm( s.val + d.val )
with
	( s.val + d.val )
to ensure that the problem really was with the call to h.lm() .

There are no virtual functions involved here.

class	hos
{
	double	val;
	double	lm( double );	// The range limiter function.
  public:
	operator	double()	{ return val; };
	. . .

	friend hos	operator + ( hos d, hos s )
	  {  hos h; h.val = h.lm( s.val + d.val ); return h; }; //Warning HERE!

	. . .
};
-- 

	from Mole End			Mark Terribile
		(scrape .. dig )	mtx5b!mat
					(Please mail to mtx5b!mat, NOT mtx5a!
						mat, or to mtx5a!mtx5b!mat)
    ,..      .,,       ,,,   ..,***_*.