Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Dave Korn" To: Subject: RE: Strange behaviour with g++ 3.4.4-1 Date: Mon, 26 Sep 2005 12:39:40 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: Message-ID: ----Original Message---- >From: Angelo Graziosi >Sent: 23 September 2005 22:01 > Rebuilding, with GCC 3.4.4-1, a few my Windows applications > (those that use -mwindows), I have found a compiler error that > was absent in the build with GCC 3.3.3-3. > > I have created the simplest test case that reproduces the 'phenomenon' > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc: > In member function `virtual typename > std::basic_stringbuf<_CharT, _Traits, _Alloc>::int_type > std::basic_stringbuf<_CharT, _Traits, _Alloc>::overflow(typename > _Traits::int_type)': > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc:102: > error: expected unqualified-id before '(' token > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc:104: > error: expected unqualified-id before '(' token Those lines are: 102 const __size_type __opt_len = std::max(__size_type(2 * __capacity), 103 __size_type(512)); 104 const __size_type __len = std::min(__opt_len, __max_size); Something #def'd min and max, making the preprocessed source look like this: const __size_type __opt_len = std::((__size_type(2 * __capacity))>(__size_type(512))?(__size_type(2 * __capacity)):(__size_type(512))); const __size_type __len = std::((__opt_len)<(__max_size)?(__opt_len):(__max_size)); It came shortly after here: # 97 "/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/windef.h" 3 You can fix it like this: dk AT mace /test/cplus> g++ test.fixed.cpp -o test dk AT mace /test/cplus> diff -pu test.cpp test.fixed.cpp --- test.cpp 2005-09-26 10:52:37.405042000 +0100 +++ test.fixed.cpp 2005-09-26 10:52:26.555119000 +0100 @@ -1,6 +1,8 @@ #include #include +#undef max +#undef min #include dk AT mace /test/cplus> cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/