From: rpolzer AT web DOT de (Rudolf Polzer) Newsgroups: comp.os.msdos.djgpp Subject: Re: Windows ME and DJGPP References: <3a78130f DOT 16030234 AT news DOT freeserve DOT net> X-newsgroup: comp.os.msdos.djgpp X-Mailer: GehtDichNenScheissdreckAn 1.0 User-Agent: GehtDichNenScheissdreckAn 1.0 Message-ID: User-Agent: slrn/0.9.6.2 (Linux) Date: Wed, 31 Jan 2001 22:30:54 +0100 Lines: 58 NNTP-Posting-Host: 213.7.27.78 X-Trace: 980976306 news.freenet.de 124 213.7.27.78 X-Complaints-To: abuse AT freenet DOT de To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Steamer schrieb Folgendes: > 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. The only problem I have with that warnings is that RHIDE misinterprets them in templates. Of course they should lead to clean code, but when I get them in some STL header file, I do not know what to do except switching it off. > > > Compiling: x.cpp > > > In function `double intconv(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.) I have version 1.4.7 of Nov 15 1998 in Linux (do not know my version in DOS, but both have the same bug). Is there a newer one, and if yes, where to get it? I got 1.4.7 from a "RHIDE homepage". > > > 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... Compared to Pascal, it is weak. > 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. Not really. C++ supports const, while C does not (and allegro is buggy here: functions like textout take a char * where a const char * would be correct; this causes code lines like textout (x, y, const_cast (s.c_str ())); which is very ugly). Why don't the allegroers just insert the const keywords? -- Nuper erat medicus, nunc est vispillo, Diaulus: Quod vispillo facit, fecerat et medicus.