public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc3.4.6: std::min and std::max
@ 2006-11-16  8:51 BG / Galaxy
  2006-11-16 12:42 ` John Love-Jensen
  0 siblings, 1 reply; 2+ messages in thread
From: BG / Galaxy @ 2006-11-16  8:51 UTC (permalink / raw)
  To: gcc-help

Hello,

I recently upgraded my system from Solaris2.5.1/gcc3.3.2 to
Solaris7/gcc3.4.6.
When recompiling my project, I often get errors in gcc files complaining
about lines using std::min or std::max,
ie:

In file included from
/usr/local/lib/gcc/sparc-sun-solaris2.7/3.4.6/../../../../include/c++/3.4.6/
vector:72,
                 from
/export/home/godev/galaxy_std_libraries/include/gerrormgr.h:32,
                 from
/export/home/godev/galaxy_std_libraries/include/gatdftostdf.h:45,
                 from import_all.h:4,
                 from filter_dialog.cpp:20:
/usr/local/lib/gcc/sparc-sun-solaris2.7/3.4.6/../../../../include/c++/3.4.6/
bits/stl_bvector.h: In member function `void std::vector<bool,
_Alloc>::_M_insert_range(std::_Bit_iterator, _ForwardIterator,
_ForwardIterator, std::forward_iterator_tag)':
/usr/local/lib/gcc/sparc-sun-solaris2.7/3.4.6/../../../../include/c++/3.4.6/
bits/stl_bvector.h:522: error: expected unqualified-id before '(' token
/usr/local/lib/gcc/sparc-sun-solaris2.7/3.4.6/../../../../include/c++/3.4.6/
bits/stl_bvector.h: In member function `void std::vector<bool,
_Alloc>::_M_fill_insert(std::_Bit_iterator, size_t, bool)':
/usr/local/lib/gcc/sparc-sun-solaris2.7/3.4.6/../../../../include/c++/3.4.6/
bits/stl_bvector.h:823: error: expected unqualified-id before '(' token

line 522 is:

       const size_type __len = size() + std::max(size(), __n);

line 823 is:

       const size_type __len = size() + std::max(size(), __n);


I get the same type of error for fstream.tcc, vector.tcc...
If I remove the std:: namespace specifier, the error disappears, but I'm not
so sure if it is correct.

I downloaded and installed a compiled package of gcc from
www.sunfreeware.com.

Any suggestions?

Thanks,
Bernard



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

* Re: gcc3.4.6: std::min and std::max
  2006-11-16  8:51 gcc3.4.6: std::min and std::max BG / Galaxy
@ 2006-11-16 12:42 ` John Love-Jensen
  0 siblings, 0 replies; 2+ messages in thread
From: John Love-Jensen @ 2006-11-16 12:42 UTC (permalink / raw)
  To: bernard.garros, MSX to GCC

Hi Bernard,

Try putting this in the code just before line 522 and line 823:

#ifdef max
#error "BZZZT: max was defined as an evil macro function"
#endif

...or use this band-aid instead before line 522 and line 823...

#ifdef max
#undef max
#define max max
#endif

HTH,
--Eljay

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

end of thread, other threads:[~2006-11-16 12:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-16  8:51 gcc3.4.6: std::min and std::max BG / Galaxy
2006-11-16 12:42 ` John Love-Jensen

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