doc/dyk/lint.html in bake-toolkit-1.8.0.1 vs doc/dyk/lint.html in bake-toolkit-2.0.10
- old
+ new
@@ -23,28 +23,45 @@
</ul>
Example:
<pre id="rundrum"><code>bake Debug -p MyLibraryProject --lint</code></pre>
<h3>How does it work</h3>
-You can lint LibraryConfigs, ExecutableConfigs and single files, but not the complete workspace. The CPP Toolchain settings
+You can lint LibraryConfigs, ExecutableConfigs, single files and the complete workspace (in this case the projects are linted separately). The CPP Toolchain settings
of the project are used regardless of the file type and file specific options.
It is possible to specify lnt-files with LintPolicy, but you can add every other lint command line option as well.<br>
A possible approach is to add global Lint policies in the DefaultToolchain like this:
<pre id="rundrum"><code>DefaultToolchain GCC {
...
LintPolicy "$(ProjectDir)/lint/misra.lnt"
LintPolicy "$(ProjectDir)/lint/suppressions.lnt"
}</code></pre>
+<h3>How to start for GCC</h3>
+Lint will fail if compiler internal includes and defines are missing. Therefore lint comes with some helper files.
+For GCC, follow the steps below.<br>
+First extract the compiler includes and defines:
+<pre id="rundrum"><code>make -f .../PcLint/../lnt/co-gcc.mak</code></pre>
+You will get some lnt files: gcc-include-path.lnt, lint_cmac.h, lint_cppmac.h and size-options.lnt.<br>
+Write a lnt file with the following content:
+<pre id="rundrum"><code>-i".../PcLint/.../lnt"
+-i"...pathToTheLntFilesExtractedAbove"
+gcc-include-path.lnt
+.../PcLint/.../lnt/co-gcc.lnt</code></pre>
+Afterwards you can test lint directly without bake like this:
+<pre id="rundrum"><code>lint-nt your.lnt test.cpp</code></pre>
+To use in bake, add a LintPolicy in Project.meta:
+<pre id="rundrum"><code>LintPolicy ".../your.lnt"</code></pre>
+
+
<h3>Notes</h3>
In rare cases lint has problems if it has to open too many (include) files. If that is the case, use --lint_min and --lint_max command line option of bake. Example:
<pre id="rundrum"><code>bake Debug -p MyLibraryProject --lint --lint_max 50 (lints the first 51 files)
bake Debug -p MyLibraryProject --lint --lint_min 51 --lint_max 100 (lints the next 50 files)
bake Debug -p MyLibraryProject --lint --lint_min 101 (lints the rest of the files)</code></pre>
<p>
-Lint in bake uses GCC includes to check system include stuff. Therefore it is required to have a working GCC installation.<br>
-But you don't have to use a config with GCC toolchain. Every other toolchain is also valid.
-
+Currently the lint output is buffered and not shown before lint has finished a project. The reason is the implementation of the error parser. This will change in future.
+<p>
+If you have another lint command than lint-nt.exe, use an alias.
</body>
</html>
\ No newline at end of file