public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/2440: istringstream problems after eof encountered
@ 2001-03-30 15:56 ian.wakeling
  0 siblings, 0 replies; 2+ messages in thread
From: ian.wakeling @ 2001-03-30 15:56 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2440
>Category:       c++
>Synopsis:       istringstream problems after eof encountered
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 30 15:56:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     ian.wakeling@knightfisk.com
>Release:        2.95.2
>Organization:
>Environment:
Debian 2.2 on an x86

gcc -v:
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)                                  
>Description:
Running the following simple program linked to Electric Fence produces the following output:
 
  Electric Fence 2.0.5 Copyright (C) 1987-1998 Bruce Perens.
read A into 0
read B into 1
read C into 2
read D into 3
eof reached
putting back D from 3
putting back C from 2
putting back B from 1
putting back A from 0
 
ElectricFence Aborting: free(bffff928): address not from malloc().
Illegal instruction                                                             
>How-To-Repeat:
source code:

#include <iostream>
#include <sstream>

int main()
{
	std::string			fred = "ABCD";
	std::istringstream	is( fred );
	char				buffer[6];

	size_t	readCount = 0;
	while
	(
		readCount < 6
	&&	is.get( buffer[ readCount ] )
	)
	{
		std::cout << "read " << buffer[ readCount ] << " into " << readCount << std::endl;
		readCount++;
	}

	if( is.eof() )
	{
		std::cout << "eof reached" << std::endl;
		is.clear();
	}

	while( readCount-- > 0 )
	{
		std::cout << "putting back " << buffer[ readCount ] << " from " << readCount << std::endl;
		is.putback( buffer[ readCount ] );
	}

	return 0;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: c++/2440: istringstream problems after eof encountered
@ 2001-03-30 17:26 Phil Edwards
  0 siblings, 0 replies; 2+ messages in thread
From: Phil Edwards @ 2001-03-30 17:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/2440; it has been noted by GNATS.

From: Phil Edwards <pedwards@disaster.jaj.com>
To: ian.wakeling@knightfisk.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/2440: istringstream problems after eof encountered
Date: Fri, 30 Mar 2001 20:32:10 -0500

 On Fri, Mar 30, 2001 at 11:46:55PM -0000, ian.wakeling@knightfisk.com wrote:
 > 
 > >Number:         2440
 > >Category:       c++
 > >Synopsis:       istringstream problems after eof encountered
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    unassigned
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Fri Mar 30 15:56:00 PST 2001
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     ian.wakeling@knightfisk.com
 > >Release:        2.95.2
 > >Organization:
 > >Environment:
 > Debian 2.2 on an x86
 > 
 > gcc -v:
 > Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
 > gcc version 2.95.2 20000220 (Debian GNU/Linux)                                  
 [...]
 > #include <sstream>
 
 GCC 2.95.2 doesn't /have/ a sstream header....
 
 
 Phil
 
 -- 
 pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
 devphil at several other less interesting addresses in various dot domains
 The gods do not protect fools.  Fools are protected by more capable fools.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-03-30 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-30 15:56 c++/2440: istringstream problems after eof encountered ian.wakeling
2001-03-30 17:26 Phil Edwards

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).