[v3] Suppress warning

Gabriel Dos Reis gdr@integrable-solutions.net
Fri Aug 20 14:40:00 GMT 2004


Nathan Sidwell <nathan@codesourcery.com> writes:

| Paolo Carlini wrote:
| > Gabriel Dos Reis wrote:
| >
| >> But his particular construct does nto deserve that warning.  And if it
| >> has been there since 3.3.,
| >>
| > Since 2.95, actually. Nobody filed a PR and nobody complained,
| > therefore, since I'm not in charge of anything having to do with the
| > compiler, I must assume the warning is correct.
| >
| >> then it is a latent bug in the compiler,
| >> not in the library.
| >>
| > Please file a PR, then, or deal with the issue right away and have
| > the patch accepted by the C++ front end maintainers. I cannot work
| > on the library with all those warnings spilled at build time,
| > masking other possible problems, and definitely refuse to revert my
| > commit.
| 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 ==

Could be?  Did you see it happen in actual practice and how often?  I
agree with warning 

   while (a = b)

but, a >>= b, this is just an overly compiler thay is doing an
overgeneralization.  With your reasoning we should warn about & or &&
because they could be a typo for one each other.  Furthermore, we
should also warn for _ (underscore) because it could be a typo for -
(minus). 

-- Gaby



More information about the Gcc-patches mailing list