Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <20010606073251.45339.qmail@web14507.mail.yahoo.com> Date: Wed, 6 Jun 2001 17:32:51 +1000 (EST) From: =?iso-8859-1?q?Danny=20Smith?= Subject: Re: bug report on gcc port To: cygwin AT cygwin DOT com In-Reply-To: <00c201c0ee02$458b0d60$6982c039@3hi25.flashcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit --- Clark Sims wrote: > The following code fragment bombs the cygwin port of gcc: > > #include > #include > > std::string foo( const std::string& rhs); > > std::string foo( const std::string& rhs) { > std::string str = rhs; > for (size_t i=0; i str[i] = ::tolower( str[i]); > } > return str; > } > > gcc -c foo.cpp : > foo.cpp: In function `class string foo(const string &)': > foo.cpp:9: parse error before `__extension__' > foo.cpp:9: `__x' undeclared (first use this function) > foo.cpp:9: (Each undeclared identifier is reported only once > foo.cpp:9: for each function it appears in.) > foo.cpp:9: parse error before `)' > > The code fragments works well in other compilers and other ports of gcc. > > Yes, the problem is in the is* and to* macros in ctype.h. Std C++ has (overloaded) functions with same name and the macros cause havoc. The macros need to be guarded with #ifndef __cplusplus In the meantime try enclosing (::tolower) in parenthesis to force use of function rather than macro. > -- > Want to unsubscribe from this list? > Check out: http://cygwin.com/ml/#unsubscribe-simple > _____________________________________________________________________________ http://messenger.yahoo.com.au - Yahoo! Messenger - Voice chat, mail alerts, stock quotes and favourite news and lots more! -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple