Skip to content
Snippets Groups Projects
Forked from Utils / KWSys
371 commits behind the upstream repository.
user avatar
Hans Johnson authored
Finds non-static member functions that can be made const because the functions
don’t use this in a non-const way.

This check tries to annotate methods according to logical constness (not
physical constness). Therefore, it will suggest to add a const qualifier to a
non-const method only if this method does something that is already possible
though the public interface on a const pointer to the object:

reading a public member variable calling a public const-qualified member
function returning const-qualified this passing const-qualified this as a
parameter.  This check will also suggest to add a const qualifier to a
non-const method if this method uses private data and functions in a limited
number of ways where logical constness and physical constness coincide:
 - reading a member variable of builtin type
Specifically, this check will not suggest to add a const to a non-const
method if the method reads a private member variable of pointer type because
that allows to modify the pointee which might not preserve logical constness.
For the same reason, it does not allow to call private member functions or
member functions on private member variables.

In addition, this check ignores functions that
 - are declared virtual
 - contain a const_cast
 - are templated or part of a class template
 - have an empty body
 - do not (implicitly) use this at all (see readability-convert-member-functions-to-static).
4c7f64eb
History
Name Last commit Last update
GitSetup
.clang-format
.gitattributes
.hooks-config
Base64.c
Base64.h.in
CMakeLists.txt
CONTRIBUTING.rst
CTestConfig.cmake
CTestCustom.cmake.in
CommandLineArguments.cxx
CommandLineArguments.hxx.in
Configure.h.in
Configure.hxx.in
ConsoleBuf.hxx.in
Copyright.txt
Directory.cxx
Directory.hxx.in
DynamicLoader.cxx
DynamicLoader.hxx.in
Encoding.h.in
Encoding.hxx.in
EncodingC.c
EncodingCXX.cxx
ExtraTest.cmake.in
FStream.cxx
FStream.hxx.in
Glob.cxx
Glob.hxx.in
IOStream.cxx
IOStream.hxx.in
MD5.c
MD5.h.in
Process.h.in
ProcessUNIX.c
ProcessWin32.c
README.rst
RegularExpression.cxx
RegularExpression.hxx.in
SetupForDevelopment.sh
SharedForward.h.in
String.c
String.h.in
String.hxx.in
System.c
System.h.in
SystemInformation.cxx
SystemInformation.hxx.in
SystemTools.cxx
SystemTools.hxx.in
Terminal.c
Terminal.h.in
clang-format.bash
hash_fun.hxx.in
hash_map.hxx.in
hash_set.hxx.in
hashtable.hxx.in
kwsysHeaderDump.pl
kwsysPlatformTests.cmake
kwsysPlatformTestsC.c
kwsysPlatformTestsCXX.cxx
kwsysPrivate.h
testCommandLineArguments.cxx
testCommandLineArguments1.cxx
testConfigure.cxx
testConsoleBuf.cxx
testConsoleBuf.hxx
testConsoleBufChild.cxx
testDirectory.cxx
testDynamicLoader.cxx
testDynload.c
testDynloadImpl.c
testDynloadImpl.h
testDynloadUse.c
testEncode.c
testEncoding.cxx
testFStream.cxx
testFail.c
testHashSTL.cxx
testProcess.c
testSharedForward.c.in
testSystemInformation.cxx
testSystemTools.bin
testSystemTools.cxx
testSystemTools.h.in
testTerminal.c
update-gitsetup.bash
update-third-party.bash

KWSys

Introduction

KWSys is the Kitware System Library. It provides platform-independent APIs to many common system features that are implemented differently on every platform. This library is intended to be shared among many projects at the source level, so it has a configurable namespace. Each project should configure KWSys to use a namespace unique to itself. See comments in CMakeLists.txt for details.

License

KWSys is distributed under the OSI-approved BSD 3-clause License. See Copyright.txt for details.

Reporting Bugs

KWSys has no independent issue tracker. After encountering an issue (bug) please submit a patch using the instructions for Contributing. Otherwise please report the issue to the tracker for the project that hosts the copy of KWSys in which the problem was found.

Contributing

See CONTRIBUTING.rst for instructions to contribute.