A tool for use with clang to analyze #includes in C and C++ source files

Include What You Use

Build Status

For more in-depth documentation, see docs.

Instructions for Users

"Include what you use" means this: for every symbol (type, function, variable, or macro) that you use in foo.cc (or foo.cpp), either foo.cc or foo.h should include a .h file that exports the declaration of that symbol. (Similarly, for foo_test.cc, either foo_test.cc or foo.h should do the including.) Obviously symbols defined in foo.cc itself are excluded from this requirement.

This puts us in a state where every file includes the headers it needs to declare the symbols that it uses. When every file includes what it uses, then it is possible to edit any file and remove unused headers, without fear of accidentally breaking the upwards dependencies of that file. It also becomes easy to automatically track and update dependencies in the source code.

CAVEAT

This is alpha quality software -- at best (as of July 2018). It was originally written to work specifically in the Google source tree, and may make assumptions, or have gaps, that are immediately and embarrassingly evident in other types of code.

While we work to get IWYU quality up, we will be stinting new features, and will prioritize reported bugs along with the many existing, known bugs. The best chance of getting a problem fixed is to submit a patch that fixes it (along with a test case that verifies the fix)!

How to Build

Include-what-you-use makes heavy use of Clang internals, and will occasionally break when Clang is updated. Usually such discrepancies are detected by build bot and fixed promptly.

The IWYU master branch follows Clang main branch.

We also have convenience tags and branches for released versions of Clang (called clang_<version>, e.g. clang_5.0). To build against a Clang release, check out the corresponding branch in IWYU before configuring the build. More details in the instructions below.

We assume you already have compiled LLVM and Clang libraries on your system, either via packages for your platform or built from source. You can use this mapping table to combine Clang and IWYU versions correctly:

Clang IWYU version IWYU branch
3.6 0.4 clang_3.6
3.7 0.5 clang_3.7
3.8 0.6 clang_3.8
3.9 0.7 clang_3.9
4.0 0.8 clang_4.0-r2
5.0 0.9 clang_5.0
6 0.10 clang_6.0
7 0.11 clang_7.0
8 0.12 clang_8.0
9 0.13 clang_9.0
10 0.14 clang_10
11 0.15 clang_11
... ... ...
main master

NOTE: If you use the Debian/Ubuntu packaging available from https://apt.llvm.org, you'll need the following packages installed:

  • llvm-<version>-dev
  • libclang-<version>-dev
  • clang-<version>

Packaging for other platforms will likely be subtly different.

To set up an environment for building:

  • Create a directory for IWYU development, e.g. iwyu

  • Clone the IWYU Git repo:

    iwyu$ git clone https://github.com/include-what-you-use/include-what-you-use.git
    
  • Presumably, you'll be building IWYU with a released version of LLVM and Clang, so check out the corresponding branch. For example, if you have Clang 6.0 installed, use the clang_6.0 branch. IWYU master tracks LLVM & Clang main:

    iwyu$ cd include-what-you-use
    iwyu/include-what-you-use$ git checkout clang_6.0
    
  • Create a build root and use CMake to generate a build system linked with LLVM/Clang prebuilts:

    # This example uses the Makefile generator, but anything should work.
    iwyu/include-what-you-use$ cd ..
    iwyu$ mkdir build && cd build
    
    # For IWYU 0.10/Clang 6 and earlier
    iwyu/build$ cmake -G "Unix Makefiles" -DIWYU_LLVM_ROOT_PATH=/usr/lib/llvm-6.0 ../include-what-you-use
    
    # For IWYU 0.11/Clang 7 and later
    iwyu/build$ cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-7 ../include-what-you-use
    

    (substitute the llvm-6.0 or llvm-7 suffixes with the actual version compatible with your IWYU branch)

    or, if you have a local LLVM and Clang build tree, you can specify that as CMAKE_PREFIX_PATH for IWYU 0.11 and later:

    iwyu/build$ cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=~/llvm-project/build ../include-what-you-use
    
  • Once CMake has generated a build system, you can invoke it directly from build, e.g.

    iwyu/build$ make
    

Instructions for building Clang are available at https://clang.llvm.org/get_started.html.

How to Install

If you're building IWYU out-of-tree or installing pre-built binaries, you need to make sure it can find Clang built-in headers (stdarg.h and friends.)

Clang's default policy is to look in path/to/clang-executable/../lib/clang/<clang ver>/include. So if Clang 3.5.0 is installed in /usr/bin, it will search for built-ins in /usr/lib/clang/3.5.0/include.

Clang tools have the same policy by default, so in order for IWYU to analyze any non-trivial code, it needs to find Clang's built-ins in path/to/iwyu/../lib/clang/3.5.0/include where 3.5.0 is a stand-in for the version of Clang your IWYU was built against.

Note that some distributions/packages may have different defaults, you can use clang -print-resource-dir to find the base path of the built-in headers on your system.

So for IWYU to function correctly, you need to copy the Clang include directory to the expected location before running (similarly, use include-what-you-use -print-resource-dir to learn exactly where IWYU wants the headers).

This weirdness is tracked in issue 100, hopefully we can make this more transparent over time.

How to Run

The original design was built for Make, but a number of alternative run modes have come up over the years.

Plugging into Make

The easiest way to run IWYU over your codebase is to run

  make -k CXX=/path/to/llvm/Debug+Asserts/bin/include-what-you-use

or

  make -k CXX=/path/to/llvm/Release/bin/include-what-you-use

(include-what-you-use always exits with an error code, so the build system knows it didn't build a .o file. Hence the need for -k.)

Include-what-you-use only analyzes .cc (or .cpp) files built by make, along with their corresponding .h files. If your project has a .h file with no corresponding .cc file, IWYU will ignore it unless you use the --check_also switch to add it for analysis together with a .cc file.

Using with CMake

CMake has grown native support for IWYU as of version 3.3. See their documentation for CMake-side details.

The CMAKE_CXX_INCLUDE_WHAT_YOU_USE option enables a mode where CMake first compiles a source file, and then runs IWYU on it.

Use it like this:

  mkdir build && cd build
  CC="clang" CXX="clang++" cmake -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="path/to/iwyu;-Xiwyu;any;-Xiwyu;iwyu;-Xiwyu;args" ...

or, on Windows systems:

  mkdir build && cd build
  cmake -DCMAKE_CXX_COMPILER="%VCINSTALLDIR%/bin/cl.exe" -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="path/to/iwyu;-Xiwyu;any;-Xiwyu;iwyu;-Xiwyu;args" -G Ninja ...

The option appears to be separately supported for both C and C++, so use CMAKE_C_INCLUDE_WHAT_YOU_USE for C code.

Note that with Microsoft's Visual C++ compiler, IWYU needs the --driver-mode=cl argument to understand the MSVC options from CMake.

Using with a compilation database

The iwyu_tool.py script predates the native CMake support, and works off the compilation database format. For example, CMake generates such a database named compile_commands.json with the CMAKE_EXPORT_COMPILE_COMMANDS option enabled.

The script's command-line syntax is designed to mimic Clang's LibTooling, but they are otherwise unrelated. It can be used like this:

  mkdir build && cd build
  CC="clang" CXX="clang++" cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ...
  iwyu_tool.py -p .

or, on Windows systems:

  mkdir build && cd build
  cmake -DCMAKE_CXX_COMPILER="%VCINSTALLDIR%/bin/cl.exe" -DCMAKE_C_COMPILER="%VCINSTALLDIR%/VC/bin/cl.exe" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja ...
  python iwyu_tool.py -p .

Unless a source filename is provided, all files in the project will be analyzed.

See iwyu_tool.py --help for more options.

Applying fixes

We also include a tool that automatically fixes up your source files based on the IWYU recommendations. This is also alpha-quality software! Here's how to use it (requires python):

  make -k CXX=/path/to/llvm/Debug+Asserts/bin/include-what-you-use 2> /tmp/iwyu.out
  python fix_includes.py < /tmp/iwyu.out

If you don't like the way fix_includes.py munges your #include lines, you can control its behavior via flags. fix_includes.py --help will give a full list, but these are some common ones:

  • -b: Put blank lines between system and Google includes
  • --nocomments: Don't add the 'why' comments next to includes

How to Correct IWYU Mistakes

  • If fix_includes.py has removed an #include you actually need, add it back in with the comment '// IWYU pragma: keep' at the end of the #include line. Note that the comment is case-sensitive.
  • If fix_includes.py has added an #include you don't need, just take it out. We hope to come up with a more permanent way of fixing later.
  • If fix_includes.py has wrongly added or removed a forward-declare, just fix it up manually.
  • If fix_includes.py has suggested a private header file (such as <bits/stl_vector.h>) instead of the proper public header file (<vector>), you can fix this by inserting a specially crafted comment near top of the private file (assuming you can write to it): '// IWYU pragma: private, include "the/public/file.h"'.

Current IWYU pragmas are described in IWYUPragmas.

Comments
  • Precompiled-headers support with --prefix_header_includes?

    Precompiled-headers support with --prefix_header_includes?

    Originally reported on Google Code with ID 126

    
    I am trying to figure out if there is any support for precompiled headers with iwyu.
    The only thing I found is to provide the precompiled header to clang with -include
    and --prefix_header_includes with to iwyu. However the results are not what I expected.
    
    For the test I am attaching, the command line reads like this:
    
    F:\tests\build\bin\Release\include-what-you-use.exe F:\tests\iwyutest\iwyutest\iwyutest.cpp
    -w -MD -I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include" -IF:\tests\iwyutest
    -IF:\tests\iwyutest\iwyutest -DWIN32 -DNDEBUG -D_CONSOLE -D_UNICODE -include F:\tests\iwyutest\iwyutest\stdafx.h
    -Xiwyu --prefix_header_includes=remove
    
    And the result is this:
    
    F:/tests/iwyutest/iwyutest/iwyutest.cpp should add these lines:
    #include "tchar.h"                      // for _TCHAR, _tmain
    
    F:/tests/iwyutest/iwyutest/iwyutest.cpp should remove these lines:
    - #include "stdafx.h"  // lines 4-4
    
    The full include-list for F:/tests/iwyutest/iwyutest/iwyutest.cpp:
    #include "tchar.h"                      // for _TCHAR, _tmain
    
    Both suggestions seem incorrect right?
    
    1) #include "tchar.h" should not be necessary because it's already included in stdafx.h
    2) stdafx.h is needed because this is a precompiled header (although I can understand
    that if there is no real support for this it can complain about it)
    
    Am I doing something wrong here?
    
    

    Reported by dpunset on 2014-04-10 14:58:55


    - _Attachment: [iwyutest.rar](https://storage.googleapis.com/google-code-attachments/include-what-you-use/issue-126/comment-0/iwyutest.rar)_
  • Assertion failed: class_decl &&

    Assertion failed: class_decl && "TemplateSpecializationType is not a TplSpecDecl?"

    Originally reported on Google Code with ID 150

    I'm trying to use iwyu with http://github.com/mapbox/mapbox-gl-native on OS X 10.9.
    I compiled iwyu against a clang 3.4.2 final stable.
    
    I'm running this command:
    
    CXX="include-what-you-use -Xiwyu --verbose=3 -isystem\"`xcode-select -p`/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1\""
    make linux
    
    and the first command gyp generates is
    
      include-what-you-use -Xiwyu --verbose=3 -isystem"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1"
    '-DNDEBUG' -I../../include -I../Release/obj/gen/include  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
    -fasm-blocks -mpascal-strings -O3 -mmacosx-version-min=10.9 -arch x86_64 -std=c++11
    -stdlib=libc++ -fvisibility-inlines-hidden -Wall -Wextra -I/usr/local/Cellar/libpng/1.6.10/include/libpng16
    -I/usr/local/include -I/Users/kkaefer/Code/gl/native/mapnik-packaging/osx/out/build-cpp11-libcpp-universal/include
    -MMD -MF ../Release/.deps/../Release/obj.target/llmr-x86/src/clipper/clipper.o.d.raw
     -c -o ../Release/obj.target/llmr-x86/src/clipper/clipper.o ../../src/clipper/clipper.cpp
    
    which fails with
    
    /Users/kkaefer/Code/include-what-you-use/iwyu.cc:3081: Assertion failed: class_decl
    && "TemplateSpecializationType is not a TplSpecDecl?"
    make[1]: *** [../Release/obj.target/llmr-x86/src/clipper/clipper.o] Abort trap: 6
    
    

    Reported by [email protected] on 2014-06-17 14:38:03

  • Absolute for relative path replacement

    Absolute for relative path replacement

    Originally reported on Google Code with ID 5

    When the compile line refers to a source file by its absolute name iwyu suggests that
    the includes be changed to absolute:
    
    jason$ cat Foo.h
    #ifndef _FOO_H_
    #define _FOO_H_
    
    class Foo {
      Foo();
    };
    
    #endif
    
    jason$ cat Foo.cpp
    #include "Foo.h"
    
    Foo::Foo() {}
    
    jason$ include-what-you-use /Users/jason/Desktop/iwyu/Foo.cpp
    
    /Users/jason/Desktop/iwyu/Foo.cpp should add these lines:
    #include </Users/jason/Desktop/iwyu/Foo.h>  // for Foo
    
    /Users/jason/Desktop/iwyu/Foo.cpp should remove these lines:
    - #include "Foo.h"  // lines 1-1
    
    The full include-list for /Users/jason/Desktop/iwyu/Foo.cpp:
    #include </Users/jason/Desktop/iwyu/Foo.h>  // for Foo
    
    ---
    
    
    However when referring to the source file by relative name the output is as expected:
    
    
    jason$ ~/Sources/llvm/build/bin/include-what-you-use Foo.cpp
    (Foo.cpp has correct #includes/fwd-decls)
    
    

    Reported by jason.haslam on 2011-02-07 07:24:43

  • In-tree build is not working (inconsistency in registered CommandLine or core dumped)

    In-tree build is not working (inconsistency in registered CommandLine or core dumped)

    When building IWYU in tree with either clang 4.0.1 or clang 5.0, the compilation succeed but I do end up with an unusable executable:

    $ include-what-you-use
    : CommandLine Error: Option 'asan-instrument-assembly' registered more than once!
    LLVM ERROR: inconsistency in registered CommandLine options
    

    I seek the issue a little bit and found some LLVM bug reference (https://reviews.llvm.org/rL240104) speaking of double link to some LLVM static lib. I did examine the link line for IWYU and discover a lot of duplicates. In fact all LLVM libs where duplicated on the command line.

    I commented out the

     target_link_libraries(include-what-you-use
        LLVMX86AsmParser # MC, MCParser, Support, X86CodeGen, X86Desc, X86Info
    ...
        LLVMDemangle
        )
    

    in IWYU CMakeLists.txt and I end up with an apparently working iwyu:

    $ include-what-you-use
    error: no input files
    error: unable to handle compilation, expected exactly one compiler job in ''
    $ include-what-you-use --version
    include-what-you-use 0.9 (git:576e80f) based on clang version 5.0.0 (tags/RELEASE_500/final)
    
    

    However on a "real" call using compilation database generated by CMake on my project (which correctly builds with either clang 4.0.1 or clang 5.0.0) I get core dumped.

    My LLVM+Clang+IWYU build uses CMake + Ninja with the following parameters:

    MY_LIBS=clang MY_VERSION=5.0 INSTALL_DIR=/local/clang cmake .. -G Ninja
    -DCLANG_ENABLE_BOOTSTRAP=On
    -DCMAKE_BUILD_TYPE=MinSizeRel
    -DCMAKE_CXX_FLAGS="-Wl,-rpath=${INSTALL_DIR}/lib/"
    -DLLVM_TARGETS_TO_BUILD="X86"
    -DLLVM_ENABLE_CXX1Y=On
    -DLLVM_LINK_LLVM_DYLIB=On
    -DLIBOMP_TSAN_SUPPORT=On
    -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR}/${MY_LIBS}/${MY_VERSION}/

    What should I do to get a working IWYU in-tree build?

  • Also add include in same directory

    Also add include in same directory

    This fixes a bug where absolute paths are unnecessarily used for a header resulting even in inclusion of unwanted headers as described in #272

    The problem arises, as the directory of the file, which is implicitely added to the search path, is not honored. See #271 for this.

    This supersedes the patch(es) in #5 and should also close those issues. This solution is better, than adding the main-files directory to the search path, as this does not add it globally which can cause problems if headers are checked, which might not be in the same directory as the main-file.

    • [x] All tests run successfully
    • [x] Fix verified by testing the test-case from #271 manually
    • [x] Remove IndirectSubfolderClass from direct_subfolder.h
    • [x] Rebase and remove DEVTOOLS_MAINTENANCE_ from tests
  • Allow build outside of clang source tree

    Allow build outside of clang source tree

    Originally reported on Google Code with ID 64

    Hi
    
    I would like to package your work into Debian. However, the fact that include-what-you-use
    needs the clang source tree greatly complexifies the build process.
    It would be nice if you could update your work to build against clang headers and libs.
    Here is a list of headers provided by the libclang-dev package in Debian and Ubuntu:
    http://packages.debian.org/sid/amd64/libclang-dev/filelist
    

    Reported by sylvestre.ledru on 2011-12-11 16:50:44

  • Unused templates are ignored on Windows

    Unused templates are ignored on Windows

    Originally reported on Google Code with ID 129

    Steps to reproduce:
    1. Run IWYU on Windows on a file
    
        #include "tests/cxx/direct.h"
        template <typename T> void foo() {
          IndirectClass ic;
        }
    
    Actual result:
    IWYU recommends to remove #include "tests/cxx/direct.h".
    
    Expected result:
    IWYU should recommend to remove #include "tests/cxx/direct.h" and to add #include "tests/cxx/indirect.h".
    

    Reported by vsapsai on 2014-04-24 16:03:06

  • Treat explicit instantiations as full uses

    Treat explicit instantiations as full uses

    Modify IsFowardDecl() to check that the decl is not an explicit template instantiation (declaration or definition) This check is also in its own function, IsExplicitInstantiation(), for convenience.

  • Install clang resources

    Install clang resources

    This is a potential fix for the years-old #100.

    The key problem in that issue is that iwyu needs to know at runtime where the clang resource headers are. If it is built in tree or installed into the same tree as llvm, that just works, but for out-of-tree use cases fail. I'm adding two solutions to this:

    1. ask the out-of-tree clang at build-time where it's resource headers are, remember and use that location at runtime.
    2. add an override to this default. This is mainly relevant when installing iwyu on a system or when you're shipping your own headers for some reason. On top of this, headers can optionally be bundled with the installation to make this work without clang present.
  • Plain cmake

    Plain cmake

    It looks like Debian packaging for Clang is fixed now, so simplify CMakeLists.txt and documentation.

    This PR is mostly to see if Travis picks up the change and builds correctly.

  • pragma keep doesn't prevent removal of dublicates

    pragma keep doesn't prevent removal of dublicates

    Originally reported on Google Code with ID 140

    Given
    ==> double.c <==
    int main()
    {
        int a;
    #include "double.h" // IWYU pragma: keep
    #include "double.h" // IWYU pragma: keep
    }
    ==> double.h <==
    a+=1;
    
    IWYU suggests double.h to be removed. The pragma should prevent also duplicates from
    being removed.
    

    Reported by [email protected] on 2014-05-30 20:07:37

  • fix_includes.py not removing #includes suggested for removal

    fix_includes.py not removing #includes suggested for removal

    Using the following source files and their corresponding headers:

    A.h

    #include <vector>
    #include <string>
    
    class A{
        public:
            int a_one;
            int a_two;
    
            A();
            void setZero();
    };
    

    A.cpp

    #include "A.h"
    
    A::A(){
        a_one = 1;
        a_two = 2;
    }
    
    void A::setZero(){
        a_one = 0;
        a_two = 0;
    }
    

    B.h

    #include "A.h"
    using namespace std;
    
    class B{
        private:
            A* b_one;
            int b_two;
            vector<int> b_three;
    
        public:
            B();
            void setZero();
            int getMem(){
                return b_one->a_one;
            }
    };
    

    B.cpp

    #include "B.h"
    
    B::B(){
        b_two = 2;
        b_one = new A();
    }
    
    void B::setZero(){
        b_two = 0;
        b_one->setZero();
    }
    
    int main(){
    }
    

    C.h

    #include "B.h"
    using namespace std;
    
    class C{
        private:
            B* c_one;
            int c_two;
            string c_three;
    
        public:
            C();
            void setZero();
    };
    

    C.cpp

    #include "C.h"
    
    C::C(){
        c_two = 2;
        c_one = new B();
        c_three = "hello";
    }
    
    void C::setZero(){
        c_two = 0;
        c_three = "";
        c_one->setZero();
    }
    

    I built these source files together and ran iwyu on them using CMake. The corresponding suggestion that I am getting in the file iwyu.out are: `Warning: include-what-you-use reported diagnostics:

    A.h should add these lines:

    A.h should remove these lines:

    - #include <string>  // lines 2-2
    - #include <vector>  // lines 1-1
    
    The full include-list for A.h:
    ---
    
    (A.cpp has correct #includes/fwd-decls)
    
    Warning: include-what-you-use reported diagnostics:
    
    B.h should add these lines:
    #include <iosfwd>  // for std
    #include <vector>  // for vector
    
    B.h should remove these lines:
    
    The full include-list for B.h:
    #include <iosfwd>  // for std
    #include <vector>  // for vector
    #include "A.h"     // for A
    ---
    
    (B.cpp has correct #includes/fwd-decls)
    
    Warning: include-what-you-use reported diagnostics:
    
    C.h should add these lines:
    #include <iosfwd>  // for std
    #include <string>  // for string
    class B;
    
    C.h should remove these lines:
    - #include "B.h"  // lines 1-1
    
    The full include-list for C.h:
    #include <iosfwd>  // for std
    #include <string>  // for string
    class B;
    ---
    
    C.cpp should add these lines:
    #include "B.h"  // for B
    
    C.cpp should remove these lines:
    
    The full include-list for C.cpp:
    #include "C.h"
    #include "B.h"  // for B
    ---
    

    This is exactly what I expect to be correct. But the python script fix_includes.py is not removing the includes which are suggested above. It only adds the includes which are suggested to be inserted. Please check this. I will greatly appreciate it.

  • <cstdio> recommended in C

    recommended in C

    See the following bogus iwyu(1) report. It's weird, because __cplusplus is not defined, and if I try to include <cstdio>, of course it errors.

    Cheers,

    Alex


    iwyu -c -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-prototypes -Werror -g -Xiwyu --no_fwd_decls -Xiwyu --error -I src -I build   \
                          \
                         \
    -o build/src/nxt_process_title.o \
    -MMD -MF build/src/nxt_process_title.dep -MT build/src/nxt_process_title.o \
    src/nxt_process_title.c
    
    src/nxt_process_title.c should add these lines:
    #include <stdarg.h>       // for va_end, va_start
    #include <sys/types.h>    // for u_char, size_t
    #include <cstdio>         // for NULL, va_list
    #include "nxt_log.h"      // for nxt_debug
    #include "nxt_malloc.h"   // for nxt_malloc
    #include "nxt_process.h"  // for NXT_SETPROCTITLE_ARGV, nxt_process_arguments
    #include "nxt_sprintf.h"  // for nxt_vsprintf
    #include "nxt_string.h"   // for nxt_strlen, nxt_memcpy, nxt_memset
    #include "nxt_types.h"    // for nxt_uint_t
    

    See with more verbosity, if it helps (I can't understand it). If you want me to run some specific flags for you, or send you complete log files, please tell me.

    $ make CC=iwyu 2>&1 | grep -e NULL -e cstdio
    [ Use macro   ] src/nxt_lib.c:132:17: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_lib.c:132:17
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stdlib.h> for NULL (#include already present)
    Ignoring full use of NULL (src/nxt_lib.c:132:17): #including dfn from <stdlib.h>
    [ Use macro   ] src/nxt_malloc.c:37:16: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_malloc.c:37:16
    [ Use macro   ] src/nxt_malloc.c:37:36: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_malloc.c:37:36
    [ Use macro   ] src/nxt_malloc.c:52:28: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_malloc.c:52:28
    [ Use macro   ] src/nxt_malloc.c:71:28: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_malloc.c:71:28
    [ Use macro   ] src/nxt_malloc.c:93:28: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_malloc.c:93:28
    [ Use macro   ] src/nxt_malloc.c:160:12: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_malloc.c:160:12
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (in associated header)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (in associated header)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (in associated header)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (in associated header)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (in associated header)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (in associated header)
    Ignoring full use of NULL (src/nxt_malloc.c:37:16): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_malloc.c:37:36): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_malloc.c:52:28): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_malloc.c:71:28): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_malloc.c:93:28): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_malloc.c:160:12): #including dfn from <stddef.h>
      |-<<<NULL>>>
      |-<<<NULL>>>
      |-<<<NULL>>>
      |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
      |-<<<NULL>>>
      |-<<<NULL>>>
      |-<<<NULL>>>
      |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    [ Use macro   ] src/nxt_credential.c:44:30: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_credential.c:44:30
    [ Use macro   ] src/nxt_credential.c:59:18: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_credential.c:59:18
    [ Use macro   ] src/nxt_credential.c:64:34: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_credential.c:64:34
    [ Use macro   ] src/nxt_credential.c:140:39: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_credential.c:140:39
    [ Use macro   ] src/nxt_credential.c:159:35: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_credential.c:159:35
    | | |-<<<NULL>>>
    | |-<<<NULL>>>
    |-<<<NULL>>>
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Ignoring full use of NULL (src/nxt_credential.c:44:30): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_credential.c:59:18): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_credential.c:64:34): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_credential.c:140:39): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_credential.c:159:35): #including dfn from <stddef.h>
    [ Use macro   ] src/nxt_isolation.c:105:32: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:105:32
    [ Use macro   ] src/nxt_isolation.c:149:38: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:149:38
    [ Use macro   ] src/nxt_isolation.c:239:58: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:239:58
    [ Use macro   ] src/nxt_isolation.c:240:16: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:240:16
    [ Use macro   ] src/nxt_isolation.c:268:61: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:268:61
    [ Use macro   ] src/nxt_isolation.c:269:18: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:269:18
    [ Use macro   ] src/nxt_isolation.c:278:61: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:278:61
    [ Use macro   ] src/nxt_isolation.c:279:18: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:279:18
    [ Use macro   ] src/nxt_isolation.c:327:35: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:327:35
    [ Use macro   ] src/nxt_isolation.c:406:22: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:406:22
    [ Use macro   ] src/nxt_isolation.c:475:63: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:475:63
    [ Use macro   ] src/nxt_isolation.c:476:16: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:476:16
    [ Use macro   ] src/nxt_isolation.c:493:56: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:493:56
    [ Use macro   ] src/nxt_isolation.c:524:67: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:524:67
    [ Use macro   ] src/nxt_isolation.c:525:17: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:525:17
    [ Use macro   ] src/nxt_isolation.c:526:66: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:526:66
    [ Use macro   ] src/nxt_isolation.c:527:22: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:527:22
    [ Use macro   ] src/nxt_isolation.c:531:61: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:531:61
    [ Use macro   ] src/nxt_isolation.c:532:22: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:532:22
    [ Use macro   ] src/nxt_isolation.c:536:62: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:536:62
    [ Use macro   ] src/nxt_isolation.c:537:22: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:537:22
    [ Use macro   ] src/nxt_isolation.c:558:24: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:558:24
    [ Use macro   ] src/nxt_isolation.c:596:33: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:596:33
    [ Use macro   ] src/nxt_isolation.c:597:19: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:597:19
    [ Use macro   ] src/nxt_isolation.c:612:41: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:612:41
    [ Use macro   ] src/nxt_isolation.c:623:34: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:623:34
    [ Use macro   ] src/nxt_isolation.c:638:39: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:638:39
    [ Use macro   ] src/nxt_isolation.c:649:34: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:649:34
    [ Use macro   ] src/nxt_isolation.c:657:39: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:657:39
    [ Use macro   ] src/nxt_isolation.c:855:61: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:855:61
    [ Use macro   ] src/nxt_isolation.c:883:11: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:883:11
    [ Use macro   ] src/nxt_isolation.c:884:14: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:884:14
    [ Use macro   ] src/nxt_isolation.c:885:16: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:885:16
    [ Use macro   ] src/nxt_isolation.c:886:18: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:886:18
    [ Use macro   ] src/nxt_isolation.c:891:33: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:891:33
    [ Use macro   ] src/nxt_isolation.c:896:33: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:896:33
    [ Use macro   ] src/nxt_isolation.c:901:35: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:901:35
    [ Use macro   ] src/nxt_isolation.c:913:20: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:913:20
    [ Use macro   ] src/nxt_isolation.c:919:53: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:919:53
    [ Use macro   ] src/nxt_isolation.c:922:16: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:922:16
    [ Use macro   ] src/nxt_isolation.c:927:37: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:927:37
    [ Use macro   ] src/nxt_isolation.c:932:37: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:932:37
    [ Use macro   ] src/nxt_isolation.c:946:23: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:946:23
    [ Use macro   ] src/nxt_isolation.c:950:27: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:950:27
    [ Use macro   ] src/nxt_isolation.c:1007:21: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:1007:21
    [ Use macro   ] src/nxt_isolation.c:1011:19: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:1011:19
    [ Use macro   ] src/nxt_isolation.c:1019:19: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:1019:19
    [ Use macro   ] src/nxt_isolation.c:1023:23: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_isolation.c:1023:23
    | |-<<<NULL>>>
    |-<<<NULL>>>
    | |-<<<NULL>>>
    | |-<<<NULL>>>
    | |-<<<NULL>>>
    | |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    | |     | |   |     `-StringLiteral 0x55eb87ad8548 'const char[13]' lvalue "lang != NULL"
    `-StringLiteral 0x55eb87ad8548 'const char[13]' lvalue "lang != NULL"
    src/nxt_isolation.c:558:5 <Spelling=<scratch space>:237:1>: (13) [ StringLiteral ] 0x55eb87ad8548 StringLiteral 0x55eb87ad8548 'const char[13]' lvalue "lang != NULL"
    | |-<<<NULL>>>
    |-<<<NULL>>>
    | |-<<<NULL>>>
    | |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    |   |-<<<NULL>>>
    |   |-<<<NULL>>>
    | |-<<<NULL>>>
    |     |-<<<NULL>>>
    |     |-<<<NULL>>>
    |     |-<<<NULL>>>
    |     |-<<<NULL>>>
    |       | |-<<<NULL>>>
    |   | |-<<<NULL>>>
      |-<<<NULL>>>
      |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
        |-<<<NULL>>>
        |-<<<NULL>>>
        |-<<<NULL>>>
        |-<<<NULL>>>
          | |-<<<NULL>>>
      |-<<<NULL>>>
      |-<<<NULL>>>
      |-<<<NULL>>>
      |-<<<NULL>>>
        | |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
      | |-<<<NULL>>>
    | |-<<<NULL>>>
    |-<<<NULL>>>
      | |-<<<NULL>>>
    | |-<<<NULL>>>
    |-<<<NULL>>>
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <stddef.h> for NULL (#include already present and needed)
    Ignoring full use of NULL (src/nxt_isolation.c:105:32): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:149:38): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:239:58): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:240:16): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:268:61): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:269:18): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:278:61): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:279:18): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:327:35): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:406:22): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:475:63): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:476:16): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:493:56): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:524:67): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:525:17): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:526:66): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:527:22): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:531:61): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:532:22): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:536:62): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:537:22): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:558:24): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:596:33): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:597:19): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:612:41): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:623:34): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:638:39): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:649:34): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:657:39): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:855:61): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:883:11): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:884:14): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:885:16): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:886:18): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:891:33): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:896:33): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:901:35): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:913:20): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:919:53): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:922:16): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:927:37): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:932:37): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:946:23): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:950:27): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:1007:21): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:1011:19): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:1019:19): #including dfn from <stddef.h>
    Ignoring full use of NULL (src/nxt_isolation.c:1023:23): #including dfn from <stddef.h>
    [ Use macro   ] src/nxt_process_title.c:55:22: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_process_title.c:55:22
    [ Use macro   ] src/nxt_process_title.c:71:28: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_process_title.c:71:28
    [ Use macro   ] src/nxt_process_title.c:83:17: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_process_title.c:83:17
    [ Use macro   ] src/nxt_process_title.c:100:20: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_process_title.c:100:20
    [ Use macro   ] src/nxt_process_title.c:108:27: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_process_title.c:108:27
    [ Use macro   ] src/nxt_process_title.c:120:14: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_process_title.c:120:14
    [ Use macro   ] src/nxt_process_title.c:135:28: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_process_title.c:135:28
    [ Use macro   ] src/nxt_process_title.c:151:16: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_process_title.c:151:16
    [ Use macro   ] src/nxt_process_title.c:165:27: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_process_title.c:165:27
    [ Use macro   ] src/nxt_process_title.c:197:18: NULL (from /usr/lib/clang/14.0.5/include/stddef.h:89:11)
    Marked full-info use of macro NULL (from /usr/lib/clang/14.0.5/include/stddef.h) at src/nxt_process_title.c:197:18
    | |-<<<NULL>>>
    | |-<<<NULL>>>
    | |-<<<NULL>>>
    | |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    |-<<<NULL>>>
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <cstdio> for NULL (set cover)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <cstdio> for NULL (set cover)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <cstdio> for NULL (set cover)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <cstdio> for NULL (set cover)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <cstdio> for NULL (set cover)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <cstdio> for NULL (set cover)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <cstdio> for NULL (set cover)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <cstdio> for NULL (set cover)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <cstdio> for NULL (set cover)
    Mapped /usr/lib/clang/14.0.5/include/stddef.h to <cstdio> for NULL (set cover)
    Mapped /usr/include/stdio.h to <cstdio> for va_list (set cover)
    src/nxt_process_title.c:55:22: warning: NULL is defined in <cstdio>, which isn't directly #included.
    src/nxt_process_title.c:71:28: warning: NULL is defined in <cstdio>, which isn't directly #included.
    src/nxt_process_title.c:83:17: warning: NULL is defined in <cstdio>, which isn't directly #included.
    src/nxt_process_title.c:100:20: warning: NULL is defined in <cstdio>, which isn't directly #included.
    src/nxt_process_title.c:108:27: warning: NULL is defined in <cstdio>, which isn't directly #included.
    src/nxt_process_title.c:120:14: warning: NULL is defined in <cstdio>, which isn't directly #included.
    src/nxt_process_title.c:135:28: warning: NULL is defined in <cstdio>, which isn't directly #included.
    src/nxt_process_title.c:151:16: warning: NULL is defined in <cstdio>, which isn't directly #included.
    src/nxt_process_title.c:165:27: warning: NULL is defined in <cstdio>, which isn't directly #included.
    src/nxt_process_title.c:193:5: warning: va_list is defined in <cstdio>, which isn't directly #included.
    src/nxt_process_title.c:197:18: warning: NULL is defined in <cstdio>, which isn't directly #included.
    #include <cstdio>         // for NULL, va_list
    #include <cstdio>         // for NULL, va_list 
    
  • typedef before struct

    typedef before struct

    I got this bug from iwyu(1) while running it on some NGINX code. Okay, the code is not ideal, but it's correct. I simplified it to a minimial reproducer:

    $ cat typedef.c
    typedef struct foo_s foo_t;
    
    struct foo_s {
        int x;
    };
    
    $ iwyu -Xiwyu --no_fwd_decls typedef.c
    
    typedef.c should add these lines:
    struct foo_s;
    
    typedef.c should remove these lines:
    
    The full include-list for typedef.c:
    struct foo_s;
    ---
    

    I kind of get the reason iwyu(1) suggests the fwd decl even if I said I don't want them: if it suggested me to include the file that provides the declaration, it would be asking me to do a self-include, and of course it doesn't.

    In the real code, I found that there's a cyclic dep between typedefs, and that's why the typedef was before the struct definition. A struct declaration before the typedef seems to me useless, so iwyu(1) should avoid warning on this if possible.

  • Prefer C <std*.h> headers over <cstd*> ones

    Prefer C headers over ones

    <cstd*> headers provide libc stuff in C++, but in the std:: namespace, which makes it incompatible with C. So the only thing it does is bring libc functionality to C++ under a different name.

    Instead, the good old C headers provide real C-compatible stuff, with the same exact semantics as in C (by using the global namespace). They also provide POSIX stuff.

    C headers <std*.h> will probably be _un_deprecated: https://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p0619r4.html#3.5, so they will be at the same level than C++ headers from a standards point of view, and they are more useful, so IMO, they should be preferred. (Although ISO C++ still discourages them, but that's not a real problem).

    Most coding styles recommend against this. Let's just ignore them, since the main reason was a nonsense deprecation.

    On top of that, due to some bug, iwyu(1) triggers the recommendation of some C++ headers in C code. Having preference for the C headers even in C++ code would fix that issue as a side effect. :)

  • IWYU not giving suggestions to public headers in project

    IWYU not giving suggestions to public headers in project

    A project I'm working on has the following hierarchy

    module
    ├── int
    │   ├── inc
    │   │   └── module
    │   │       ├── lib1
    │   │       ├── lib2
    │   │       └── lib3
    │   └── src
    │       ├── lib1
    │       ├── lib2
    │       ├── lib3
    │       └── CMakeLists.txt
    ├── pub
    │   ├── inc
    │   │   └── module
    │   │       ├── lib1
    │   │       ├── lib2
    │   │       └── lib3
    │   └── src
    │       ├── lib1
    │       ├── lib2
    │       ├── lib3
    │       └── CMakeLists.txt
    ├── CMakeLists.txt
    └── module.imp
    

    IWYU gives advice for the contents of /int/... but not /pub/... is there any way to fix this? If it requires adding to the codebase, I'd be happy to implement it fwiw

    a typical compile command would be

    /usr/local/bin/clang++ -I/module/pub/inc -I/module/int/inc  -O3 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -mcx16 -fwrapv -fexceptions -fno-strict-aliasing -fnon-call-exceptions -fno-omit-frame-pointer -finline-functions -Wall -Wextra -Wno-comment -Wno-long-long -Wno-attributes -Wno-deprecated-register -Wno-unused-private-field -Wno-unused-local-typedef -Wno-invalid-source-encoding -Wno-unused-command-line-argument -Wno-inconsistent-missing-override -Werror=return-type -O3 -g -gz -pthread -std=c++17 -o module/int/src/lib1/CMakeFiles/lib1.dir/Release/example.cpp.o -c /module/int/src/lib1/example.cpp
    

    I will try make a minimal reproducible example if needs be

Qt-oriented static code analyzer based on the Clang framework

WARNING: master is the development branch. Please use the v1.10 branch. clazy v1.11 clazy is a compiler plugin which allows clang to understand Qt sem

Jun 22, 2022
ELF static analysis and injection framework that parse, manipulate and camouflage ELF files.

elfspirit elfspirit is a useful program that parse, manipulate and camouflage ELF files. It provides a variety of functions, including adding or delet

Jun 15, 2022
CMetrics measures size and complexity for C files

C metrics package ================= INSTALL ------- see INSTALL file USAGE ----- cmetrics [-h] [-f] [-p] [-n] target_dir positional arguments:

May 27, 2022
Tool to check C++ #include dependencies (dependency graphs created in .dot format)
Tool to check C++ #include dependencies (dependency graphs created in .dot format)

Read Me for Dependency Checker Copyright (C) 2012-2017, TomTom International BV. All rights reserved. The tool cpp-dependencies creates #include depen

Jun 1, 2022
A static analysis tool that helps security researchers scan a list of Windows kernel drivers for common vulnerability patterns in drivers (CVE makers!)
A static analysis tool that helps security researchers scan a list of Windows kernel drivers for common vulnerability patterns in drivers (CVE makers!)

Driver Analyzer A static analysis tool that helps security researchers scan a list of Windows kernel drivers for common vulnerability patterns in driv

Jun 13, 2022
A static analyzer for Java, C, C++, and Objective-C
A static analyzer for Java, C, C++, and Objective-C

Infer Infer is a static analysis tool for Java, C++, Objective-C, and C. Infer is written in OCaml. Installation Read our Getting Started page for det

Jun 17, 2022
Analysis of Argon and Xenon Collision data to test Bardeen-Cooper-Schrieffer Approximation

Univeristy of North Carolina Wilmington Analysis of Argon and Xenon Collision data to test Bardeen-Cooper-Schrieffer Approximation. Argon Data Tree Fi

Nov 15, 2021
Flint++ is cross-platform, zero-dependency port of flint, a lint program for C++ developed and used at Facebook.

Flint++ A Cross Platform Port of Facebook's C++ Linter Flint++ is cross-platform, zero-dependency port of flint, a lint program for C++ developed and

Jun 2, 2022
A tool for use with clang to analyze #includes in C and C++ source files

Include What You Use For more in-depth documentation, see docs. Instructions for Users "Include what you use" means this: for every symbol (type, func

Jun 21, 2022
A distribution of the cFS that includes the cfe-eds-framework which includes NASA's core Flight Executive(cFE) and CCSDS Electronic Data Sheets(EDS) support.

core Flight System(cFS) Application Toolkit(cFSAT) - Beta Release A distribution of the cFS that includes the cfe-eds-framework which includes NASA's

Mar 25, 2022
Strings Analyze tool for all platforms

Strings Analyze Inspired by @UnrealSecurity Strings Analyze Strings Analyze is a tool for all platform to analyze string dumps from process' memory or

Oct 11, 2021
Bear is a tool that generates a compilation database for clang tooling.

ʕ·ᴥ·ʔ Build EAR Bear is a tool that generates a compilation database for clang tooling. The JSON compilation database is used in the clang project to

Jun 23, 2022
Clang build analysis tool using -ftime-trace

Clang Build Analyzer Clang C/C++ build analysis tool when using Clang 9+ -ftime-trace. The -ftime-trace compiler flag (see blog post or Clang 9 releas

Jun 16, 2022
A program and toolset to analyze iDevice USB sessions

A program and toolset to analyze iDevice USB sessions

May 26, 2022
Development of a system which can capture and analyze transmitted data on a USB wire.
  Development of a system which can capture and analyze transmitted data on a USB wire.

FPGA based USB protocol analyser Development of a system which can capture and analyze transmitted data on a

Apr 3, 2022
Calleree helps to analyze Ruby's caller-callee relationships.

Calleree Calleree helps to analyze Ruby's caller-callee relationships. Note that this tool consumes memory and introduces additional overhead because

Sep 23, 2021
Analyze patches in a process for investigation or repairment purposes.
Analyze patches in a process for investigation or repairment purposes.

HookHunter Analyze patches in a process for investigation or repairment purposes. Details HookHunter is a multi-purpose Windows tool that can search a

Jun 10, 2022
Binary Ninja plugin & workflow to help analyze Objective-C code
Binary Ninja plugin & workflow to help analyze Objective-C code

Objective Ninja Objective Ninja is a Binary Ninja plugin to assist in reverse engineering Objective-C code. Beware, Objective Ninja is still in very e

Jun 8, 2022
Analyze precision

analyze-precision Analyze fix-point precision for unary functions This program allows, for a given unary function, to explore the relations between th

May 3, 2022