Bug 1056733

Summary: Please enable cppcheck --rule (make HAVE_RULES=yes)
Product: [Fedora] Fedora Reporter: Josh Stone <jistone>
Component: cppcheckAssignee: François Cami <contribs>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: contribs, susi.lehtola
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cppcheck-1.63-3.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-31 04:26:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Josh Stone 2014-01-22 19:21:02 UTC
Description of problem:
It is possible to use cppcheck with custom rules, but this is not enabled in the Fedora build.

Version-Release number of selected component (if applicable):
cppcheck-1.63-2.fc20.x86_64

How reproducible:
100%

Steps to Reproduce:
1. cppcheck --rule=.+ SRCFILE

Actual results:
cppcheck: error: unrecognized command line option: "--rule=.+".

Expected results:
Since ".+" matches everything, it should dump the full representation of SRCFILE, as described in the "Writing Cppcheck rules" article.

Additional info:
A little history spelunking shows that the rpm used to define HAVE_RULES, but removed it in fedpkg commit 5165102588cd for 1.51-2.  Upstream flipped the default to HAVE_RULES=no in commit 34e2a2ad663ae, released in 1.52.  You can also see in koji that the cppcheck-1.51 rpm requires libpcre.so.0, and the 1.52 rpm does not.

It's very close timing between upstream flipping the default HAVE_RULES and the Fedora rpm undefining it, but I hope that's just coincidence, so Fedora can enable rules again.

Comment 1 François Cami 2014-01-22 19:40:14 UTC
I've switched HAVE_RULES to yes in rawhide:
http://koji.fedoraproject.org/koji/taskinfo?taskID=6441252

If Susi does not object to this change, I'll build for f20 too.

Comment 2 François Cami 2014-01-22 19:44:18 UTC
It's quite possible HAVE_RULES was switched to no because it failed to build:
http://sourceforge.net/apps/trac/cppcheck/ticket/3783
this was fixed in 1.55 or so.

Comment 3 Susi Lehtola 2014-01-22 19:55:44 UTC
(In reply to François Cami from comment #1)
> If Susi does not object to this change, I'll build for f20 too.

Of course not, go ahead!

Comment 4 François Cami 2014-01-22 20:01:36 UTC
Thank you Susi!

Building for f20:
http://koji.fedoraproject.org/koji/taskinfo?taskID=6441322

Comment 5 Fedora Update System 2014-01-22 20:20:53 UTC
cppcheck-1.63-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/cppcheck-1.63-3.fc20

Comment 6 Josh Stone 2014-01-22 22:24:04 UTC
Thank you for the quick turnaround!

Comment 7 Fedora Update System 2014-01-23 11:04:03 UTC
Package cppcheck-1.63-3.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing cppcheck-1.63-3.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-1363/cppcheck-1.63-3.fc20
then log in and leave karma (feedback).

Comment 8 François Cami 2014-01-23 11:52:16 UTC
You're welcome. It was an easy one, though - bugs rarely contain the fix for themselves :)

Comment 9 Fedora Update System 2014-01-31 04:26:51 UTC
cppcheck-1.63-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.