delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/07/22/17:13:06

From: "A. Sinan Unur" <asu1 AT c-o-r-n-e-l-l DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Question about the latest GNU C++
Date: 22 Jul 2003 20:42:41 GMT
Organization: Cornell University
Lines: 57
Sender: asu1 AT cornell DOT invalid (on pool-141-149-210-226.syr.east.verizon.net)
Message-ID: <Xns93C0AA00BA207asu1cornelledu@132.236.56.8>
References: <20030722191204 DOT 5818 DOT qmail AT web20001 DOT mail DOT yahoo DOT com>
NNTP-Posting-Host: pool-141-149-210-226.syr.east.verizon.net
X-Trace: news01.cit.cornell.edu 1058906560 25525 141.149.210.226 (22 Jul 2003 20:42:41 GMT)
X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu
NNTP-Posting-Date: 22 Jul 2003 20:42:41 GMT
User-Agent: Xnews/5.04.25
X-Face: #0:Oa+WV[,\dU+SJ\X%#!MhGkG;vsj^Tzl1KJHck]V;S8u}yvJ<rd?.0]p2-6jgTf.>p~GpGgD.mLo)IY,&yDRM1dV3z'Y'8D=+Y7k[|[~mGbV(<(8Im%IhZkC9.A.&]TGcwX9GKGgA,lqReCST$aDsGKy#zU~laO|oJiD$e"6&_tzrxT}K,X_e,FC&}P8J"x~ii,lr6)L}=tZI#cNU,7u]J"TLISliDF2pmIKR`ulX=X-sB2aM?f4wIG5Z_nXceH~5}E*t+vx!unlkVJ7]57x`%S1\gR{.1_^Gu2L'am[/=c]'7Hj1l^Yx!nCe40dFkW
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Bill Gerics <gericsb AT yahoo DOT com> wrote in
news:20030722191204 DOT 5818 DOT qmail AT web20001 DOT mail DOT yahoo DOT com: 

> Hello,
>  
> I have downloaded the latest GNU C++ and noticed some major changes.
>  
> 1) Header files no longer have the .h extension
>  
> 2) cin, cout and cerr are no longer supported by the iostream library.
> I must modify my calls to these functions to std:: cin, std::cout
> etc-- 
>  
> Why are these changes made 

See the C++ standard.

> that make my code no longer backwards
> compatible and is there anything I can do to my existing programs to
> get them to compile short of making the changes mentioned above.  It
> would seem that these cj=hanges have made existing C++ literature and
> examples obsolete. 

gcc does include backward compatibility headers. Although I recommend you 
familiarize yourself with standard C++, you can still use

#include <iostream.h>

in your code, and it will compile as before (although you'll get warnings 
about depracated language features unless you disable them):

C:\Home>cat old.cc
#include <iostream.h>

int main()
{
    cout << "Hello World!\n";
    return 0;
}

C:\Home\asu1>gxx -Wall old.cc -o old.exe
In file included from c:/djgpp/lang/cxx/3.23/backward/iostream.h:31,
                 from old.cc:1:
c:/djgpp/lang/cxx/3.23/backward/backward_warning.h:32:2: warning: 
#warning This file includes at least one deprecated or antiquated header. 
Please consider using one of the 32 headers found in section 17.4.1.2 of 
the C++ standard. Examples include substituting the <X> header for the 
<X.h> header for C++ includes, or <sstream> instead of the deprecated 
header <strstream.h>. To disable this warning use -Wno-deprecated.

Sinan.

-- 
A. Sinan Unur
asu1 AT c-o-r-n-e-l-l DOT edu
Remove dashes for address
Spam bait: mailto:uce AT ftc DOT gov

- Raw text -


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