[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-12-18 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. I put up https://reviews.llvm.org/D41368 to just suppress the warnings instead. https://reviews.llvm.org/D39149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-12-18 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. In https://reviews.llvm.org/D39149#958378, @bcain wrote: > Let's resurrect these changes since https://reviews.llvm.org/D39462 was not > the right short-term approach. Let's not. IMHO, these changes are: - a bad idea in principle - clang should not be warning

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-12-18 Thread Brian Cain via Phabricator via cfe-commits
bcain added a comment. In https://reviews.llvm.org/D39149#912260, @smeenai wrote: > I confirmed that these warnings go away with https://reviews.llvm.org/D39462 > applied, and they reappear if I manually specify > `-Wmaybe-tautological-constant-compare`. Thank you! Let's resurrect these

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-31 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai abandoned this revision. smeenai added a comment. I confirmed that these warnings go away with https://reviews.llvm.org/D39462 applied, and they reappear if I manually specify `-Wmaybe-tautological-constant-compare`. Thank you! https://reviews.llvm.org/D39149

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-31 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D39149#910825, @mclow.lists wrote: > I dislike this change fairly strongly. > I would much rather pursue a clang-based solution (since clang is being > unhelpful here) > Don't know if we can get one, though. @smeenai

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. In https://reviews.llvm.org/D39149#911024, @rsmith wrote: > In https://reviews.llvm.org/D39149#910936, @smeenai wrote: > > > I'm thinking you could account for all possible type sizes in the existing > > (enabled by default) warning, and have a different warning for

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D39149#911024, @rsmith wrote: > In https://reviews.llvm.org/D39149#910936, @smeenai wrote: > > > I'm thinking you could account for all possible type sizes in the existing > > (enabled by default) warning, and have a different warning for

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D39149#910936, @smeenai wrote: > I'm thinking you could account for all possible type sizes in the existing > (enabled by default) warning, and have a different warning for possibly > tautological comparisons. E.g. if a `long` is being

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Brian Cain via Phabricator via cfe-commits
bcain added a comment. In https://reviews.llvm.org/D39149#910931, @lebedev.ri wrote: > In https://reviews.llvm.org/D39149#910891, @bcain wrote: > > > In https://reviews.llvm.org/D39149#910845, @lebedev.ri wrote: > > > > > That is my diagnostic, so i guess this is the time to reply :) > > > > > >

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. In https://reviews.llvm.org/D39149#910931, @lebedev.ri wrote: > - The fact that under *different* circumstances the comparison is not > tautological is not a false-positive. It's not technically a false positive, but my suspicion is that it'll make the warning a lot

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. I'm thinking you could account for all possible type sizes in the existing (enabled by default) warning, and have a different warning for possibly tautological comparisons. E.g. if a `long` is being compared against `INT_MAX`, you know that's only tautological on some

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D39149#910891, @bcain wrote: > In https://reviews.llvm.org/D39149#910845, @lebedev.ri wrote: > > > That is my diagnostic, so i guess this is the time to reply :) > > > ... > > > 3. In `-Wtautological-constant-compare`, ignore any

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Brian Cain via Phabricator via cfe-commits
bcain added a comment. In https://reviews.llvm.org/D39149#910845, @lebedev.ri wrote: > That is my diagnostic, so i guess this is the time to reply :) ... > 3. In `-Wtautological-constant-compare`, ignore any comparisons that compare > with `std::numeric_limits`. Not a fan of this solution.

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. In https://reviews.llvm.org/D39149#910825, @mclow.lists wrote: > I dislike this change fairly strongly. Agreed. Would you be happier with just disabling the diagnostics around the problematic parts? In https://reviews.llvm.org/D39149#910845, @lebedev.ri wrote: > 1.

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai planned changes to this revision. smeenai added a comment. In https://reviews.llvm.org/D39149#910858, @mclow.lists wrote: > If we have to go down this road, I'd prefer the approach used in >

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. If we have to go down this road, I'd prefer the approach used in http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp?r1=315874=315873=315874 https://reviews.llvm.org/D39149

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a subscriber: thakis. lebedev.ri added a comment. That is my diagnostic, so i guess this is the time to reply :) In https://reviews.llvm.org/D39149#910825, @mclow.lists wrote: > I dislike this change fairly strongly. > I would much rather pursue a clang-based solution (since

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. I dislike this change fairly strongly. I would much rather pursue a clang-based solution (since clang is being unhelpful here) Don't know if we can get one, though. https://reviews.llvm.org/D39149 ___ cfe-commits

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-27 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. Ping. Like I said, not a huge fan of this change, but also not a huge fan of running into clang diagnostics (especially since we build with `-Werror` downstream). https://reviews.llvm.org/D39149 ___ cfe-commits mailing

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-20 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai created this revision. Tip-of-tree clang produces `-Wtautological-constant-compare` for tautological constant comparisons, and these pieces of code will trigger that diagnostic when `int` and `long` have the same size (for example, when compiling for a 32-bit target, or for Windows