# Analysis modes

The analysis can operate in *Automatic Configuration* (AutoConfig) or *Manual Configuration* (Compilation Database) modes.

AutoConfig is activated by default, while the Compilation Database can be activated by supplying a `compile_commands.json` to the SonarScanner.

The analyzer must understand the code’s intended compilation options to ensure an accurate static analysis of the CFamily code.

* In Compilation Database mode, these options are provided to the analyzer through [Compilation Database](https://clang.llvm.org/docs/JSONCompilationDatabase.html): a JSON file introduced by the LLVM project.
* In AutoConfig mode, the analyzer attempts to deduce these options automatically. A set of high-level AutoConfig properties can tune the automatic deduction process. See the "AutoConfig-specific properties" section in [Customizing the analysis](/sonarqube-server/2025.5/analyzing-source-code/languages/c-family/customizing-the-analysis.md).

## Choosing the right analysis mode <a href="#choosing-the-right-analysis-mode" id="choosing-the-right-analysis-mode"></a>

AutoConfig mode is recommended if:

* Your projects use compilers that don’t meet the supported compiler prerequisites of Compilation Database mode.
* Your projects use compilation environments where generating a compilation database is not feasible (see [Prerequisites](/sonarqube-server/2025.5/analyzing-source-code/languages/c-family/prerequisites.md)).
* You desire a swift analysis setup without the need to allocate human resources for the generation and maintenance of the Compilation Database.
* Your projects have a low CFamily code percentage.

Compilation Database mode is recommended if:

* You seek the highest CFamily analysis quality SonarQube Server can provide. Please note that in rare instances, AutoConfig may result in some issues being overlooked.
* You want to have finer control over the analysis configuration. For example, if you want to analyze a specific build variant or several variants (see "Analyzing code variants" in [Customizing the analysis](/sonarqube-server/2025.5/analyzing-source-code/languages/c-family/customizing-the-analysis.md)).
* You have projects with Objective-C code: Objective-C analysis is not supported in AutoConfig mode.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-server/2025.5/analyzing-source-code/languages/c-family/analysis-modes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
