This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libstdc++/4220: min/max problem in std_limits.h



>Number:         4220
>Category:       libstdc++
>Synopsis:       min/max problem in std_limits.h
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 04 01:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     bjornw@planetarion.com
>Release:        gcc version 3.1 20010901 (experimental)
>Organization:
>Environment:
redhat-6.2 (all pacthed up june 2001), kernel-2.4.9
>Description:
Compiling any program that includes (at some point in the include-chain) std_limits.h fails to do so because there are some conflicts with min/max.


I'm sure there is a more sane fix than the below fix but it at least make my programs compile...
>How-To-Repeat:
Compile any program that include std_limits.h
>Fix:
std_limits.h:897:

#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif

      static _Tp min() throw() { return static_cast<_Tp>(0); }
      static _Tp max() throw() { return static_cast<_Tp>(0); }


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]