[Bug libstdc++/69782] [6 Regression] defining min() macro causes thousand of lines of error messages

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 14 09:49:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69782

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #7)
> So is the plan to uglify all
> find libstdc++-v3/include -type f | xargs grep '[^a-zA-Z_]\(min\|max\)(' |
> wc -l
> 461
> with ()s around min/max or whatever id-expression it appears at the end of?

I started doing that, and it made me want to hit myself in the face with a
hammer.

Adding a header that #undefs the macros and including it everywhere necessary
is a much smaller patch, and doesn't obfuscate hundreds of valid uses of
min/max functions in the library. It also means users can call the std min/max
functions without parentheses because any macros have been removed. It doesn't
allow people to continue using their undefined macros, but those people are
immoral anyway.

> For 6.x or just 7.x?

I find it hard to care about code with min/max macros.


More information about the Gcc-bugs mailing list