delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/05/18/12:11:34

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <19990518160932.6510.rocketmail@web807.mail.yahoo.com>
Date: Tue, 18 May 1999 09:09:32 -0700 (PDT)
From: Rick Rankin <rick_rankin AT yahoo DOT com>
Subject: Re: bug in egcs-1.1.2?
To: "Suhaib M. Siddiqi" <ssiddiqi AT ipass DOT net>, mike DOT fabian AT it-mannesmann DOT de,
cygwin AT sourceware DOT cygnus DOT com
MIME-Version: 1.0

No, they shouldn't. The standard header files no longer end in .h, although
some compilers are providing equivalent .h files for backward compatibility.
With gcc, for example, there is a <utility>, but no <utility.h>.

Rick

--- "Suhaib M. Siddiqi" <ssiddiqi AT ipass DOT net> wrote:
> 
> Should these
> 
> #include <iostream>
> #include <string>
> #include <utility>
> #include <deque>
> #include <list>
> 
> 
> NOT be
> 
> #include <iostream.h>
> #include <string.h>
> #include <utility.h>
> #include <deque.h>
> #include <list.h>
> 
> or whatever????
> 
> 
> ----- Original Message ----- 
> From: Mike Fabian <mike DOT fabian AT it-mannesmann DOT de>
> To: <cygwin AT sourceware DOT cygnus DOT com>
> Sent: Tuesday, May 18, 1999 11:20 AM
> Subject: bug in egcs-1.1.2?
> 
> 
> > Hello,
> > 
> > I encountered a problem while using Mumit Khan's egcs-1.1.2 release.
> > 
> > (~$ g++ --version
> > egcs-2.91.66       )
> > 
> > the following small test program doesn't compile with egcs-1.1.2
> > 
> > ----------------------------------------------------------------------
> > #include <iostream>
> > #include <string>
> > #include <utility>
> > #include <deque>
> > #include <list>
> > 
> > class PairsOfStrings : public std::deque<std::pair<std::string,std::string>
> > 
> > {
> > };
> > 
> > void main(int argc, char* argv[]) 
> > {
> > PairsOfStrings d;
> > std::string s1("field1"),s2("value1"),s3("field2"),s4("value2");
> > d.push_back(std::make_pair(s1,s2));
> > d.push_back(std::make_pair(s3,s4));
> > 
> > std::string str = "";
> > for(PairsOfStrings::const_iterator p=d.begin();p!=d.end();p++) {
> > // the following line doesn't compile with egcs:
> > str += p->first + p->second;  
> > }
> > std::cout << str << std::endl;
> > }
> > ----------------------------------------------------------------------
> > The error message is:
> > 
> > test.cpp: In function `int main(...)':
> > test.cpp:21: result of `operator->()' yields non-pointer result
> > test.cpp:21: result of `operator->()' yields non-pointer result
> > 
> > When `list' is used instead of `deque', the program compiles fine
> > and works as expected.
> > 
> > With Microsoft's VC 5.0 the program compiles without errors
> > for `deque' as well (and the program runs correctly).
> > 
> > Is this possibly a bug in egcs??
> > 
> > 
> > Mike
> > 
> > PS:
> > here is the complete output of the compiler:
> > ----------------------------------------------------------------------
> > cd d:/home/fabian/cpp/
> > g++ test.cpp -o test.exe
> >
>
C:/cygnus/cygwin-b20/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/egcs-2.91.66/../../../../../include/g++/stl_deque.h:
> In method `const struct
>
pair<basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
>
>,basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> > > &
>
__deque_iterator<pair<basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
>
>,basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> > >,const
>
pair<basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
>
>,basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> > > &,const
>
pair<basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
>
>,basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> > > &,0>::operator
>
-><pair<basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
>
>,basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> > >, const
>
pair<basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
>
>,basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> > > &, const
>
pair<basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
>
>,basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> > > &, 0>() const':
> > test.cpp:21:   instantiated from here
> >
>
C:/cygnus/cygwin-b20/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/egcs-2.91.66/../../../../../include/g++/stl_deque.h:132:
> conversion from `const
>
pair<basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
>
>,basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> > > *' to non-scalar type
>
`pair<basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
>
>,basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> > >' requested
> > test.cpp: In function `int main(...)':
> > test.cpp:21: result of `operator->()' yields non-pointer result
> > test.cpp:21: result of `operator->()' yields non-pointer result
> > 
> > Compilation exited abnormally with code 1 at Tue May 18 15:41:19
> > ----------------------------------------------------------------------
> > 
> > 
> > --
> > Want to unsubscribe from this list?
> > Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
> > 
> > 
> 
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
> 
> 

_____________________________________________________________
Do You Yahoo!?
Free instant messaging and more at http://messenger.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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