CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2023-02-03
by Scott McPeak

Original Post

Original - Posted on 2022-04-11
by jaques-sam



            
Present in both answers; Present only in the new answer; Present only in the old answer;

When you say, "according to the --help -p is the way to specify the path to it", I think you're referring to this passage from the [Clang-Tidy](https://clang.llvm.org/extra/clang-tidy/) page:
``` -p <build-path> is used to read a compile command database.
For example, it can be a CMake build directory in which a file named compile_commands.json exists (use -DCMAKE_EXPORT_COMPILE_COMMANDS=ON CMake option to get this output). When no build path is specified, a search for compile_commands.json will be attempted through all parent paths of the first input file . See: https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html for an example of setting up Clang Tooling on a source tree. ```
As it says, `-p` helps `clang-tidy` find the [compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html), which tells `clang-tidy` how to compile the listed source files, but it does not actually specify what files to analyze. (In general, the database can say how to compile many things, but you might only want to analyze a subset.)
To specify what to analyze, you have to list all of the file names on the command line after the options. There is, perhaps unfortunately, no way to ask `clang-tidy` to analyze everything in the compilation database.

Specify the location explicitly using `-p` like `-p ${CMAKE_BUILD_DIR}`: ``` -p <build-path> is used to read a compile command database.
For example, it can be a CMake build directory in which a file named compile_commands.json exists (use -DCMAKE_EXPORT_COMPILE_COMMANDS=ON CMake option to get this output). When no build path is specified, a search for compile_commands.json will be attempted through all parent paths of the first input file . See: https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html for an example of setting up Clang Tooling on a source tree. ```

        
Present in both answers; Present only in the new answer; Present only in the old answer;