cppcheck/gui/help/ch02.html

9 lines
2.9 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 2. Getting started</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="Cppcheck 1.44"><link rel="up" href="index.html" title="Cppcheck 1.44"><link rel="prev" href="ch01.html" title="Chapter 1. Introduction"><link rel="next" href="ch02s02.html" title="Checking all files in a folder"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Getting started</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 2. Getting started"><div class="titlepage"><div><div><h2 class="title"><a name="id2607467"></a>Chapter 2. Getting started</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="ch02.html#id2623157">First test</a></span></dt><dt><span class="section"><a href="ch02s02.html">Checking all files in a folder</a></span></dt><dt><span class="section"><a href="ch02s03.html">Excluding a file or folder from checking</a></span></dt><dt><span class="section"><a href="ch02s04.html">Stylistic issues</a></span></dt><dt><span class="section"><a href="ch02s05.html">Saving results in file</a></span></dt><dt><span class="section"><a href="ch02s06.html">Unused functions</a></span></dt><dt><span class="section"><a href="ch02s07.html">Enable all checks</a></span></dt><dt><span class="section"><a href="ch02s08.html">Multithreaded checking</a></span></dt></dl></div><div class="section" title="First test"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2623157"></a>First test</h2></div></div></div><p>Here is a simple code</p><pre class="programlisting">int main()
{
char a[10];
a[10] = 0;
return 0;
}</pre><p>If you save that into <code class="filename">file1.c</code> and
execute:</p><pre class="programlisting">cppcheck file1.c</pre><p>The output from cppcheck will then be:</p><pre class="programlisting">Checking file1.c...
[file1.c:4]: (error) Array 'a[10]' index 10 out of bounds</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 1. Introduction </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Checking all files in a folder</td></tr></table></div></body></html>