Your message dated Sun, 03 May 2015 09:49:57 +0000
with message-id <[email protected]>
and subject line Bug#754215: fixed in cppcheck 1.69-1
has caused the Debian Bug report #754215,
regarding cppcheck: Reducing of variable scope
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
754215: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754215
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cppcheck
Version: 1.65-1
Severity: normal

Dear Maintainer,

I checked my program in C++ using the "cppcheck -q --enable=all --template=gcc
../" And I think that I have faced with a false warning.

My function performs a some action when entering the loop - each time except
the first. Boolean variable (flag of first entry) is declared before the cycle
and is initialized to "true" (first entry). It is assigned a "false" (re-entry)
inside the loop. Example:

/* forward.cpp */

int
main()
{
        bool first_time = true;
        while (true) {
                if (first_time) {
                        first_time = false;
                }
                else {
                        // do something
                }
        }
}

Cppcheck does not detect errors in this code. But my code was written a little
differently, though he worked the same way. My code is:

/* backward.cpp */

int
main()
{
        bool first_time = true;
        while (true) {
                if (not first_time) {
                        // do something
                }
                else {
                        first_time = false;
                }
        }
}

Output of cppcheck:
backward.cpp:4: style: The scope of the variable 'first_time' can be reduced.
backward.cpp:10: style: Variable 'first_time' is assigned a value that is never
used.

I think that it is wrong, because these two pieces of code perform the same.
Also, if to follow this recommendation of cppcheck, code meaning changes
completely.

I am using Debian GNU/Linux jessie/sid, kernel 3.14-1-686-pae and libc6 2.19-4
Version of cppcheck: 1.65-1



-- System Information:
Debian Release: jessie/sid
  APT prefers testing-proposed-updates
  APT policy: (500, 'testing-proposed-updates'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.14-1-686-pae (SMP w/8 CPU cores)
Locale: LANG=ru_UA.UTF-8, LC_CTYPE=ru_UA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cppcheck depends on:
ii  libc6          2.19-4
ii  libgcc1        1:4.9.0-7
ii  libpcre3       1:8.31-5
ii  libstdc++6     4.9.0-7
ii  libtinyxml2-2  2.0.2-1

cppcheck recommends no packages.

cppcheck suggests no packages.

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: cppcheck
Source-Version: 1.69-1

We believe that the bug you reported is fixed in the latest version of
cppcheck, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Reijo Tomperi <[email protected]> (supplier of updated cppcheck 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 02 May 2015 21:38:07 +0300
Source: cppcheck
Binary: cppcheck
Architecture: source amd64
Version: 1.69-1
Distribution: unstable
Urgency: low
Maintainer: Reijo Tomperi <[email protected]>
Changed-By: Reijo Tomperi <[email protected]>
Description:
 cppcheck   - tool for static C/C++ code analysis
Closes: 706496 706498 718801 723892 754215 776581 778926
Changes:
 cppcheck (1.69-1) unstable; urgency=low
 .
   * New upstream release
   * Fix misprocessing of typedef. Closes: #706496
   * Fix goto handling. Closes: #706498
   * Fix cpp synbol handing in C code. Closes: #718801
   * Fix internal error. Closes: #723892
   * Fix variable scope check. Closes: #754215
   * Fix new version. Closes: #776581
   * Fix segfault. Closes: #778926
Checksums-Sha1:
 d0921fb609e164679cd143e8e19d1403215e4bb3 1800 cppcheck_1.69-1.dsc
 75da97aca2991a88840d52993e012c95ded6f7ff 1366770 cppcheck_1.69.orig.tar.gz
 543bc1490f91ac62ab2b3b2581e680b815041f68 364452 cppcheck_1.69-1.debian.tar.xz
 4ae7dbaaabd39547fe7d491e6c47f6de35989297 729476 cppcheck_1.69-1_amd64.deb
Checksums-Sha256:
 18d456847a5c79c22701a6e63547ebdda60063d48d7b15c47418ef01760ab008 1800 
cppcheck_1.69-1.dsc
 fe61c9df64eb5ff170b866237045aae6427d47edcff9b684abac2d11fb4d7826 1366770 
cppcheck_1.69.orig.tar.gz
 e7cda3f2ae72f316a130954eef0720e5896a2257e114d7d1328bd2235ec3a959 364452 
cppcheck_1.69-1.debian.tar.xz
 488c9c3333cfcea4edd7f09cb49229d5e7a1aea43731caebac29e4c9934ed398 729476 
cppcheck_1.69-1_amd64.deb
Files:
 6503894180b2e25a1ef180ef17f624af 1800 devel optional cppcheck_1.69-1.dsc
 53f0511fc24044a563d0e558b499324b 1366770 devel optional 
cppcheck_1.69.orig.tar.gz
 be86d971f121cac70bec5a66e1be3fdc 364452 devel optional 
cppcheck_1.69-1.debian.tar.xz
 a5486c7c6a730b8914ad01aeb9692383 729476 devel optional 
cppcheck_1.69-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJVReI7AAoJELj6/xxDiGdxZYoP/R27SZd8R+PWSnpingiamuG/
G7qR52Q85V/OIR8cwbT77ugzc2O0uwGew1wRO6qsYUlWcAvRNh7pAocAePr1o4Pz
JAFMNgqRPXVIbOmc+21SnmI89GGbG6/H3CheODY3yDjd9LBXjJZ1oUar6wUUj3eZ
6f+O5I/sko1v5P86vIqu0SY3OWZZ/I74Rez2YifISmaZHurafImp7t2sXgeLNRXr
3LeFO6oYCkzfgDAYvDNL9GyLFbzKMmmq696GpOefr78y7iVb2ndEF4/etbK9e1Yq
pCn7Pe6029gpMDiZXT+GBxtByc67ECr6uxIkSTbi+35y1zbRLFlnbRPRYMF07vR2
+VLrZLHXwSyz7OvbBdQqUfB3Yo+kxX4DaIgsKU/7nOqyl8KK5n4q2yTinN6UjZKv
okrCCGXFzjpp3Vc6qZX7d+QE0gEL2UPqv3307/OlJZLaT+W+aKkWCE3Xa8tglPNC
zbszALz+fqEJxRIKiqi6uDthRxy+tgEapudaQ7YDEPzyajKIjlgd4OyPMCxQykzT
zbkC60vTvdg15cugkJx28M4C6Hm4a6bDlCi3LIhRF/2DThj/iMZwQiXDozP6qlTP
2wvNbGwxl3VevGpcV1AsPNsmBKefA93NV6KO6bS4xcv4VwsuFiNjPuFfzwxMpFHq
0LIzgHMgiCtsn2tVjZfu
=DZS5
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to