delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/31/08:36:39

From: dontmailme AT iname DOT com (Steamer)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Windows ME and DJGPP
Date: Wed, 31 Jan 2001 13:29:12 GMT
Organization: always disorganized
Lines: 34
Message-ID: <3a78130f.16030234@news.freeserve.net>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010131101046 DOT 29266K-100000 AT is>
NNTP-Posting-Host: modem-24.oklahoma.dialup.pol.co.uk
X-Trace: news5.svr.pol.co.uk 980947753 17521 62.137.87.24 (31 Jan 2001 13:29:13 GMT)
NNTP-Posting-Date: 31 Jan 2001 13:29:13 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Free Agent 1.11/32.235
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:

> On Mon, 29 Jan 2001, Rudolf Polzer wrote:
> 
> > no -W switch, the only warnings I accept are about implicit conversions
> > between int and double since an explicit typecast for such a conversion
> > (static_cast) looks terrible. Since I often use long double and I do not
> > like C cast notation, but long double a = long double (b) does not work, I
> > consequently cast implicitly between the both.
> 
> Hmm?  Is this in C or in C++?  I don't think you need any casts in a C
> program for assigning int to a double or the other way around.

Nor do you in C++.  It's strange that GCC chooses to warn about
this in C++ but not in C.

> > Compiling: x.cpp
> > In function `double intconv<double>(double>':
> > x.cpp (9) Error: instantiated from here

(Of course, this isn't an error, it's just a RHIDE misinterpretation
of a warning message, which was what Rudolf Polzer was pointing out.
I thought this was fixed in newer versions of RHIDE.)

> > x.cpp (3) Warning:  initialization to `int' from `double'
> 
> If you don't like strongly typed languages, don't use C++.

Some people consider C++ to be a weakly typed language.
It depends on your perspective...

In any case, C++ is only slightly more strongly typed than C,
and there is no difference at all as far as initializing an int
with a double is concerned.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019