@@ -753,7 +753,9 @@ Checking test.c...
753753 < dealloc> Unlock< /dealloc>
754754 < /resource>
755755
756- < ignore> IsEqual< /ignore>
756+ < function name="IsEqual">
757+ < leak-ignore/>
758+ < /function>
757759
758760 < function name="AssignFred">
759761 < noreturn> false< /noreturn>
@@ -776,10 +778,10 @@ Checking test.c...
776778 <literal >CloseWilma</literal >.</para >
777779
778780 <para >The <literal >< use> </literal > and
779- <literal >< ignore> </literal > elements are used to control the leaks
780- checking. If it should be ignored that a function is called, use
781- <literal >< ignore> </literal >. If there is no leak whenever the memory
782- is passed to a function, use <literal >< use> </literal >.</para >
781+ <literal >< leak- ignore> </literal > elements are used to control the
782+ leaks checking. If it should be ignored that a function is called, use
783+ <literal >< leak- ignore> </literal >. If there is no leak whenever the
784+ memory is passed to a function, use <literal >< use> </literal >.</para >
783785
784786 <para >In the <literal >< function> </literal > block some useful info is
785787 added about function behaviour. The <literal >< noreturn> </literal >
@@ -797,12 +799,13 @@ Checking test.c...
797799
798800 <para >No configuration is necessary for the standard functions. The
799801 strcpy() was chosen in this example for demonstration purposes because
800- its behaviour is well-known. </para >
802+ its behaviour is well-known.</para >
801803
802804 <para >The proper configuration for the standard strcpy() function would
803805 be:</para >
804806
805807 <programlisting > < function name="strcpy">
808+ < leak-ignore/>
806809 < noreturn> false< /noreturn>
807810 < arg nr="1">
808811 < not-null/>
@@ -813,17 +816,22 @@ Checking test.c...
813816 < /arg>
814817 < /function> </programlisting >
815818
819+ <para >The <literal >< leak-ignore/> </literal > is optional and it
820+ tells Cppcheck to ignore this function call in the leaks checking.
821+ Passing allocated memory to this function won't mean it will be
822+ deallocated.</para >
823+
816824 <para >The <literal >< noreturn> </literal > is optional. But it's
817825 recommended.</para >
818826
819- <para >The first parameter that the function takes is a pointer. It must
827+ <para >The first argument that the function takes is a pointer. It must
820828 not be a null pointer, a uninitialized pointer nor a dead pointer. It
821829 must point at some data, this data can be initialized but it is not
822830 wrong if it isn't. Using <literal >< not-null> </literal > is correct.
823831 <literal >Cppcheck</literal > will check by default that the pointer is
824832 not uninitialized nor dead.</para >
825833
826- <para >The second parameter the function takes is a pointer. It must not
834+ <para >The second argument the function takes is a pointer. It must not
827835 be null. And it must point at initialized data. Using
828836 <literal >< not-null> </literal > and
829837 <literal >< not-uninit> </literal > is correct.</para >
0 commit comments