home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.g++.bug
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!dcs.warwick.ac.UK!jeff
- From: jeff@dcs.warwick.ac.UK (Jeff Smith)
- Subject: libg++ on sun-3 reveals problem with g++
- Message-ID: <14378.199301051325@sprog>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Mon, 4 Jan 1993 17:47:51 GMT
- Approved: bug-g++@prep.ai.mit.edu
- Lines: 49
-
- The following program generates the errors:
-
- /tmp/K.C: In function `double hypot (double, double)':
- /tmp/K.C:21: warning: float or double assigned to integer data type
- /tmp/K.C:21: warning: float or double assigned to integer data type
-
- However, these conversions should not have been selected at all, and
- cfront-3.0.1 correctly calls the double sqrt (double x) routine. The
- problem comes to light on a sun-3 when you make libg++, because the
- math-68881.h header contains equivalent code, but it would appear that
- all recent g++ compilers actually have the bug. I compiled this
- particular example on a sun-4 with gcc-2.3.3. Any ideas anyone...?
- --------------------------------------------------------------------------
-
-
-
- class Integer
- {
- public:
- Integer(long);
- Integer(const Integer&);
- operator long() const;
- operator double() const;
- };
-
- extern Integer sqrt(const Integer&);
-
- extern "C" {
- extern double sqrt (double x);
-
- }
-
- /*extern "C" { */
- double hypot ( double x, double y)
- {
- double temp= x*x + y*y;
- temp = sqrt(temp);
- return temp;
- }
-
- /*}*/
-
-
-
- --
- Jeff Smith, Computer Science, Warwick University, Coventry, CV4 7AL, England
- jeff@dcs.warwick.ac.uk phone: +44 203 523485 fax: +44 203 525714
-
-
-