This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3] Suppress warning
Nathan Sidwell <nathan@codesourcery.com> writes:
| Falk Hueffner wrote:
| > Nathan Sidwell <nathan@codesourcery.com> writes:
| >
| >>IMHO,
| >> while (a <<= b)
| >>deserves a warning, as much as
| >> while (a = b)
| >>the former could be a typo for <=, just as the latter be one for ==
| > Well, it could, but does this really happen in practise? I'd guess
| > I've myself confused = and == or seen others do it about 50 times or
| > so, but zero times for <<= vs. <=. IMHO we should not introduce
| > warnings unless there's empirical evidence people really make these
| > mistakes.
| it's not just that someone might typo <=, it's another programmer
The issue is not whether we could conceive of that as a typo. But
whether it happens in practice and how often.
| debugging an error and wondering whether <<= is a typo or not.
The same holds for & and &&, or _ and -, for example.