.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "CLAZY 1" .TH CLAZY 1 "2023-01-18" "1.11.0" "KDAB" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" clazy \- a static source code analyzer for Qt5\-based C++. .SH "SYNOPSIS" .IX Header "SYNOPSIS" clazy [option] [clang++\-options] .SH "DESCRIPTION" .IX Header "DESCRIPTION" clazy scans \*(C+/Qt source code looking for issues related to good coding practice with of Qt5. In typical use, during code compilation with clazy you will see any such warnings printed to the output normally as you would find any compiler warnings. .PP clazy has the ability to \*(L"fix\*(R" the offending code in some cases. See the \fB\s-1CLAZY_FIXIT\s0\fR environment variable description below for more information. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-\-help\fR" 4 .IX Item "--help" Print help message and exit. .IP "\fB\-\-version\fR" 4 .IX Item "--version" Print version information and exit. .IP "\fB\-\-list\fR" 4 .IX Item "--list" Print a list of all available checkers, arranged by level. .IP "\fB\-\-explain\fR" 4 .IX Item "--explain" Print explanations for all checkers. .IP "\fB\-\-explain\fR " 4 .IX Item "--explain " Print explanations for the checkers matching the specified regular expression. .PP Any of the options above will print the requested information and then exit. .IP "\fB\-\-qt4compat\fR" 4 .IX Item "--qt4compat" This option runs clazy in Qt4 compatibility mode. Use this when your source code can build with Qt4 and Qt5 in order to easily suppress issues that cannot be fixed due to the requirement of the Qt4 \s-1API.\s0 .Sp This is a convenience option which is identical to directly passing: \*(L"\-Xclang \-plugin\-arg\-clazy \-Xclang qt4\-compat\*(R" .IP "\fB\-\-qtdeveloper\fR" 4 .IX Item "--qtdeveloper" \&\fBFor Qt developers only.\fR This option is special for running clazy on Qt itself. Will result in fewer false positives being reported in Qt code. .Sp This is a convenience option which is identical to directly passing: \*(L"\-Xclang \-plugin\-arg\-clazy \-Xclang qt-developer\*(R" .PP All other options are passed directly to clang++ and handled from there. .PP See the clang manual for a list of the very large set of options available, but in normal operation you \*(L"compile\*(R" your code with clazy just as you would with clang. .SH "EXAMPLES" .IX Header "EXAMPLES" .IP "Print a list of all available checkers, arranged by check level:" 4 .IX Item "Print a list of all available checkers, arranged by check level:" .Vb 1 \& % clazy \-\-list \& \& List of available clazy checkers: \& \& Checks from level0. Very stable checks, 100% safe, no false\-positives: \& connect\-non\-signal \& container\-anti\-pattern \& lambda\-in\-connect \& mutable\-container\-key \& qdatetime\-utc \& qenums \& qfileinfo\-exists \& .... .Ve .IP "Compile your CMake project with clazy default checkers:" 4 .IX Item "Compile your CMake project with clazy default checkers:" .Vb 2 \& % cmake \-DCMAKE_CXX_COMPILER=clazy \& then make as normal .Ve .IP "Compile your CMake project with level2 checks only (non-Windows):" 4 .IX Item "Compile your CMake project with level2 checks only (non-Windows):" .Vb 3 \& % export CLAZY_CHECKS="level2" \& % cmake \-DCMAKE_CXX_COMPILER=clazy \& then make as normal .Ve .IP "Compile your qmake project with clazy default checkers:" 4 .IX Item "Compile your qmake project with clazy default checkers:" .Vb 2 \& % qmake \-spec linux\-clang QMAKE_CXX=clazy \& then make as normal .Ve .SH "IN-CODE DIRECTIVES" .IX Header "IN-CODE DIRECTIVES" clazy supports the following list of in-code directives: .IP "clazy:skip" 4 .IX Item "clazy:skip" .Vb 2 \& Exempt an entire file from all checks. \& No clazy tests will run on the file. .Ve .IP "clazy:excludeall=" 4 .IX Item "clazy:excludeall=" .Vb 2 \& Exempt the entire file from the specified checks. \& The clazy checks name1, etc will not be run on this file. .Ve .IP "clazy:exclude=" 4 .IX Item "clazy:exclude=" .Vb 3 \& Exclude individual lines from specific checks. \& The clazy checks tests name1, etc. will not be run on the line where \& this directive is found. .Ve .PP Don't include the 'clazy\-' prefix. For example, to disable the \*(L"qstring-allocations\*(R" check, you would write: .PP .Vb 1 \& // clazy:exclude=qstring\-allocations .Ve .PP and not .PP .Vb 1 \& // clazy:exclude=clazy\-qstring\-allocations .Ve .PP Also note that these directives must be \*(C+ style comments; C style comments are ignored. .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" \&\fB\s-1CLAZY_CHECKS\s0\fR \- a comma-separated list of checkers or check-sets to run. By default, all checkers from the \*(L"level0\*(R" and \*(L"level1\*(R" check-sets will run. .PP \&\fBExamples:\fR .ie n .IP "1. Enables the 2 checkers ""unneeded-cast"" and ""virtual-call-ctor"" only:" 4 .el .IP "1. Enables the 2 checkers ``unneeded-cast'' and ``virtual-call-ctor'' only:" 4 .IX Item "1. Enables the 2 checkers unneeded-cast and virtual-call-ctor only:" % export CLAZY_CHECKS=\*(L"unneeded\-cast,virtual\-call\-ctor\*(R" .ie n .IP "2. Enables all checks from the ""level0"" check-set, except for ""qenums"":" 4 .el .IP "2. Enables all checks from the ``level0'' check-set, except for ``qenums'':" 4 .IX Item "2. Enables all checks from the level0 check-set, except for qenums:" % export CLAZY_CHECKS=\*(L"level0,no\-qenums\*(R" .ie n .IP "3. Enables all checks from the ""level0"" check-set along with the ""detaching-temporary"" checker:" 4 .el .IP "3. Enables all checks from the ``level0'' check-set along with the ``detaching-temporary'' checker:" 4 .IX Item "3. Enables all checks from the level0 check-set along with the detaching-temporary checker:" % export CLAZY_CHECKS=\*(L"level0,detaching\-temporary\*(R" .PP \&\fB\s-1CLAZY_FIXIT\s0\fR \- some checkers are able to automatically re-write your source code whenever it encounters code it can \*(L"fix\*(R". Enable this \*(L"fixit\*(R" feature by setting this variable to the name of the checker with a \*(L"fixit\*(R" capability. .PP \&\fBExamples:\fR .IP "1. Fix qlatin1string allocations:" 4 .IX Item "1. Fix qlatin1string allocations:" % export CLAZY_FIXIT=\*(L"fix\-qlatin1string\-allocations\*(R" .IP "2. Fix old-style (simple cases) connect statements:" 4 .IX Item "2. Fix old-style (simple cases) connect statements:" % export CLAZY_FIXIT=fix\-old\-style\-connect .Sp More documentation is provided when running clazy with the \fB\-\-explain\fR command line option. .Sp Also note that only 1 fixit checker can be run at a time. .PP \&\fB\s-1CLAZY_EXTRA_OPTIONS\s0\fR \- some checkers can adapt their behavior depending on the value of this environment variable. More documentation is provided when running clazy with the \fB\-\-explain\fR command line option. .PP \&\fB\s-1CLAZY_NO_WERROR\s0\fR \- if this is variable is set, clazy will not treat warnings as errors, even if the \-Werror compiler option is specified. This is useful if you want to use \-Werror only for the regular gcc/clang warnings but not for clazy warnings. .PP \&\fB\s-1CLAZY_CHECKS_AS_ERRORS\s0\fR \- comma-separated list of checks that will be promoted to compiler errors. Note that this does not enable the checks specified here. .PP \&\fB\s-1CLAZY_IGNORE_DIRS\s0\fR \- A regular expression for paths to exclude from processing. For example: .PP % export CLAZY_IGNORE_DIRS=\*(L".*my_qt_folder.*\*(R" .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2015\-2017 Klaralvdalens Datakonsult \s-1AB,\s0 a \s-1KDAB\s0 Group company, .PP This library is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. .PP This library is distributed in the hope that it will be useful, but \s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0 See the \s-1GNU\s0 Lesser General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 Lesser General Public License along with this library. If not, see . .SH "SEE ALSO" .IX Header "SEE ALSO" .Vb 2 \& clang(1) \& https://www.kdab.com/use\-static\-analysis\-improve\-performance .Ve .SH "AUTHORS" .IX Header "AUTHORS" .Vb 10 \& Sergio Martins \& Laurent Montel \& Allen Winter \& Albert Astals Cid \& Aure\*'lien Ga\*^teau \& Kevin Funk \& Hannah von Reth \& Volker Krause \& Christian Ehrlicher \& Mathias Hasselmann .Ve