public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/8469: Obsolete iostream.h and fstream.h?
@ 2002-11-05 16:16 Phil Edwards
0 siblings, 0 replies; 5+ messages in thread
From: Phil Edwards @ 2002-11-05 16:16 UTC (permalink / raw)
To: paolo; +Cc: gcc-prs
The following reply was made to PR libstdc++/8469; it has been noted by GNATS.
From: Phil Edwards <phil@jaj.com>
To: rdnjr@houston.rr.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/8469: Obsolete iostream.h and fstream.h?
Date: Tue, 5 Nov 2002 19:14:03 -0500
On Tue, Nov 05, 2002 at 09:36:06PM -0000, rdnjr@houston.rr.com wrote:
> >Description:
> Compiling any program that includes iostream.h, or fstream.h yields an
> 'Obsolete header file' warning, but will NOT compile the program.
And the error message is...? We're not telepathic.
> If I take
> those includes out and replace cout's with printf's, so on and so forth,
Then you're no longer using the C++ library.
> >How-To-Repeat:
> compile any program with '#include <iostream.h>', and include a 'cout <<' statement in it.
This works for everybody else.
The I/O headers with .h were never part of any language standard, so their
contents vary from one compiler to another. We provide them just to help
in moving old C++ code to correct C++ code. You may be assuming that a
.h file provides more than it does.
As a start, try including <foo> instead of <foo.h>, and placing a 'using'
statement after the header.
Phil
--
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
- Edsger Dijkstra, 1930-2002
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: libstdc++/8469: Obsolete iostream.h and fstream.h?
@ 2002-11-19 12:30 bkoz
0 siblings, 0 replies; 5+ messages in thread
From: bkoz @ 2002-11-19 12:30 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, paolo, rdnjr
Synopsis: Obsolete iostream.h and fstream.h?
State-Changed-From-To: feedback->closed
State-Changed-By: bkoz
State-Changed-When: Mon Nov 11 15:10:09 2002
State-Changed-Why:
This is not a bug.
If you'd like to use the C++ files like <iostream>, you'll have to use namespace std. Like so:
std::cout << "hello world" << std::endl
or
using namespace std;
cout << "hello, world" << endl;
If you'd like to use the deprecated .h include files, like <iostream.h>, you don't need to use namespace std as everythig is in the global namespace.
All this and more are described in most into to C++ textbooks.
best,
benjamin
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8469
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: libstdc++/8469: Obsolete iostream.h and fstream.h?
@ 2002-11-07 14:06 R. D. Nichols, Jr.
0 siblings, 0 replies; 5+ messages in thread
From: R. D. Nichols, Jr. @ 2002-11-07 14:06 UTC (permalink / raw)
To: paolo; +Cc: gcc-prs
The following reply was made to PR libstdc++/8469; it has been noted by GNATS.
From: "R. D. Nichols, Jr." <rdnjr@houston.rr.com>
To: <gcc-gnats@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>,
<paolo@gcc.gnu.org>, <rdnjr@houston.rr.com>
Cc:
Subject: Re: libstdc++/8469: Obsolete iostream.h and fstream.h?
Date: Thu, 7 Nov 2002 15:57:19 -0600
This is a multi-part message in MIME format.
------=_NextPart_000_0017_01C28676.5A5862C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
After reading the reply, I was able to get rid of the 'obsolete header =
file' error from before by substituting <iostream.h> with <iostream>. I =
now get the following error while trying to compile the world famous =
'Hello World' program:
test.cc: In function 'int main()':
test.cc:5: 'cout' undeclared (first use this function)
test.cc:5: (Each undeclared identifier is reported only once for each =
function it appears in.)
Sorry for not including my compiler spew from beforel
Thanks,
R. D. Nichols, Jr.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview audit-trail
------=_NextPart_000_0017_01C28676.5A5862C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV>After reading the reply, I was able to get rid of the =
'obsolete header=20
file' error from before by substituting <iostream.h> with=20
<iostream>. I now get the following error while trying to =
compile=20
the world famous 'Hello World' program:</DIV>
<DIV> </DIV>
<DIV>test.cc: In function 'int main()':</DIV>
<DIV>test.cc:5: 'cout' undeclared (first use this function)</DIV>
<DIV>test.cc:5: (Each undeclared identifier is reported only once for =
each=20
function it appears in.)</DIV>
<DIV> </DIV>
<DIV>Sorry for not including my compiler spew from beforel</DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV>R. D. Nichols, Jr.</DIV></FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV><A=20
href=3D"http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview">http://gcc.gnu=
.org/cgi-bin/gnatsweb.pl?cmd=3Dview</A>=20
audit-trail</BODY></HTML>
------=_NextPart_000_0017_01C28676.5A5862C0--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: libstdc++/8469: Obsolete iostream.h and fstream.h?
@ 2002-11-05 14:59 paolo
0 siblings, 0 replies; 5+ messages in thread
From: paolo @ 2002-11-05 14:59 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, paolo, rdnjr
Synopsis: Obsolete iostream.h and fstream.h?
Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Tue Nov 5 14:59:49 2002
Responsible-Changed-Why:
.
State-Changed-From-To: open->feedback
State-Changed-By: paolo
State-Changed-When: Tue Nov 5 14:59:49 2002
State-Changed-Why:
What do you mean exatly by "will NOT compile"?
I can successfully compile and run the following:
//////////////////////
#include <iostream.h>
int main()
{
cout << "Paolo" << endl;
}
////////////////
paolo:~> g++ paolo.cc
In file included from /usr/include/c++/3.2.1/backward/iostream.h:31,
from paolo.cc:1:
/usr/include/c++/3.2.1/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.
paolo:~> a.out
Paolo
paolo:~>
////////////////
Could you please provide the output of g++ -v your_test.cc?
Thanks, Paolo.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8469
^ permalink raw reply [flat|nested] 5+ messages in thread
* libstdc++/8469: Obsolete iostream.h and fstream.h?
@ 2002-11-05 13:46 rdnjr
0 siblings, 0 replies; 5+ messages in thread
From: rdnjr @ 2002-11-05 13:46 UTC (permalink / raw)
To: gcc-gnats
>Number: 8469
>Category: libstdc++
>Synopsis: Obsolete iostream.h and fstream.h?
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: support
>Submitter-Id: net
>Arrival-Date: Tue Nov 05 13:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: rdnjr
>Release: gcc 3.2-7
>Organization:
>Environment:
RedHat 8.0
>Description:
Compiling any program that includes iostream.h, or fstream.h yields an 'Obsolete header file' warning, but will NOT compile the program. If I take those includes out and replace cout's with printf's, so on and so forth, everything works. Did something happen to fstream.h that I am not aware of?
>How-To-Repeat:
compile any program with '#include <iostream.h>', and include a 'cout <<' statement in it.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-11-11 23:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-05 16:16 libstdc++/8469: Obsolete iostream.h and fstream.h? Phil Edwards
-- strict thread matches above, loose matches on Subject: below --
2002-11-19 12:30 bkoz
2002-11-07 14:06 R. D. Nichols, Jr.
2002-11-05 14:59 paolo
2002-11-05 13:46 rdnjr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).