[Bug libstdc++/29989] New: missed #undef min/max in <limits>

pluto at agmk dot net gcc-bugzilla@gcc.gnu.org
Sun Nov 26 12:29:00 GMT 2006


testcase:

#define max(a,b) quirk
#include <limits>

output:

/usr/include/c++/4.1.2/limits:293:22: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:323:23: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:377:23: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:428:30: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:479:32: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:530:26: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:581:24: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:632:33: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:683:22: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:734:31: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:785:23: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:836:32: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:887:28: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:938:37: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:989:24: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:1046:25: error: macro "max" requires 2 arguments,
but only 1 given
/usr/include/c++/4.1.2/limits:1103:30: error: macro "max" requires 2 arguments,
but only 1 given


i think <limits> requires the same protection as <bits/stl_algobase.h>


-- 
           Summary: missed #undef min/max in <limits>
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29989



More information about the Gcc-bugs mailing list