[PATCH] D12359: New warning -Wnonconst-parameter when a pointer parameter can be const
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 18 08:02:19 PST 2015
On Wed, Nov 18, 2015 at 7:41 AM, Daniel Marjamäki <
cfe-commits at lists.llvm.org> wrote:
> danielmarjamaki marked an inline comment as done.
> danielmarjamaki added a comment.
> Does anybody else think that this should be moved to clang-tidy?
> I believe that the noise level is very low when I scan various open source
depends how you define noise, though - and the Clang project has
historically (& Richard's comments indicate that philosophy is ongoing)
treated anything that didn't indicate a bug or bug-like issue (where bug is
"this program behaves differently from the way the programmer intended it
to") as noise, so every instance of this diagnostic is noise by that
definition, I believe (the suggested changes, by design, never change the
behavior of the program)
> My script tries to run clang on all projects in the debian archive. I have
> shown triaged results before, but if you are not convinced I can upload the
> complete results so you can look at that. For comparison, I get more noise
> from existing compiler warnings.
> Comment at: include/clang/AST/Decl.h:791
> @@ +790,3 @@
> + /// \brief Whether this variable has non-const use so it can't be
> + unsigned NonConstUse:1;
> hmm.. I'll change "variable" to "parameter" in the next diff.
> Comment at: include/clang/AST/Decl.h:857
> @@ -853,3 +856,3 @@
> typedef redeclarable_base::redecl_range redecl_range;
> typedef redeclarable_base::redecl_iterator redecl_iterator;
> Thanks! I have moved NonConstUse to ParmVarDeclBits.
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits