Bug 1056733 - Please enable cppcheck --rule (make HAVE_RULES=yes)
Summary: Please enable cppcheck --rule (make HAVE_RULES=yes)
Alias: None
Product: Fedora
Classification: Fedora
Component: cppcheck
Version: 20
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: François Cami
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2014-01-22 19:21 UTC by Josh Stone
Modified: 2014-01-31 04:26 UTC (History)
2 users (show)

Fixed In Version: cppcheck-1.63-3.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-01-31 04:26:51 UTC

Attachments (Terms of Use)

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):

How reproducible:

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:

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:
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:

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.

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:
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.

Note You need to log in before you can comment on or make changes to this bug.