I found this bug in cygwin's gcc, but it is probably general problem. #include <cmath> fails to undefine math.h's macro log2. I personally thinks, that like other math functions, log2 shoud be function in namespace std, not macro. (Bug found, when I was defining own int log2(int) function in class)
-- Summary: cmath do not undef log2 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ppershing at gmail dot com GCC host triplet: all GCC target triplet: all http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35104