EricWF added a comment.

In https://reviews.llvm.org/D33080#752202, @bcraig wrote:

> I like the warning that you generate for min and max macros existing.


Only on warn on platforms where we don't have `#pragma push_macro/pop_macro`.

> Is the push_macro / pop_macro the right way to go though?  You could throw 
> extra parenthesis around the declaration and usages of min/max to avoid macro 
> expansion.

I noticed that the Windows STL headers have to do this dance with `new` (even 
though they do `(foo)(...)` for `min` and `max`). If we're going to need
to guard against a bunch of macros I would like to use a single approach.  
Other than updating the `#if defined(min) || defined(max)` lines it's trivial 
to guard
against additional macros.

Also there are a lot of call sites and declarations for `min` and `max`.  I 
think this approach is less invasive and more consistent. We're obviously not 
going to
use `(foo)(...)` syntax everywhere, so lets use it nowhere.


https://reviews.llvm.org/D33080



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to