🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #140

A bug in cfront, I think ?

#140
From: m.terribile
Date: Thu, 03 Apr 1986 02:31
32 lines
1502 bytes
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)
    ,..      .,,       ,,,   ..,***_*.
Technical Details
Message-ID: <1262@mtx5a.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!akguc!mtunh!mtung!mtunf!mtx5c!mtx5d!mtx5a!mat

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site mtx5a.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!akguc!mtunh!mtung!mtunf!mtx5c!mtx5d!mtx5a!mat
From: mat@mtx5a.UUCP (m.terribile)
Newsgroups: net.lang.c++
Subject: A bug in cfront, I think ?
Message-ID: <1262@mtx5a.UUCP>
Date: Wed, 2-Apr-86 21:31:31 EST
Article-I.D.: mtx5a.1262
Posted: Wed Apr  2 21:31:31 1986
Date-Received: Sat, 5-Apr-86 12:13:31 EST
Distribution: net
Organization: AT&T Information Systems, Middletown, NJ 07748-4801.
Lines: 32