[Bug libstdc++/69782] New: [6 Regression] defining min() macro causes thousand of lines of error messages
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 12 10:55:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69782
Bug ID: 69782
Summary: [6 Regression] defining min() macro causes thousand of
lines of error messages
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
Target Milestone: ---
markus@x4 /tmp % cat minmax.h
#include <math.h>
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#include <iostream>
markus@x4 /tmp % g++ -c minmax.h 2>&1 | wc -l
1199
markus@x4 /tmp % clang++ -stdlib=libc++ -c minmax.h
clang-3.9: warning: treating 'c-header' input as 'c++-header' when in C++ mode,
this behavior is deprecated
In file included from minmax.h:5:
In file included from /usr/include/c++/v1/iostream:38:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:15:
In file included from /usr/include/c++/v1/string:439:
In file included from /usr/include/c++/v1/algorithm:628:
In file included from /usr/include/c++/v1/memory:605:
In file included from /usr/include/c++/v1/limits:112:
/usr/include/c++/v1/__undef_min_max:16:2: warning: : macro min is incompatible
with C++. #undefing min [-W#warnings]
#warning: macro min is incompatible with C++. #undefing min
^
1 warning generated.
More information about the Gcc-bugs
mailing list