Bug 1663372
Summary: | pcp does not set include dir for cppcheck | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Mark Goodwin <mgoodwin> | ||||
Component: | pcp | Assignee: | Mark Goodwin <mgoodwin> | ||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 29 | CC: | brolley, fche, lberk, mgoodwin, mtasaka, mtasaka, nathans, scox, susi.lehtola | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | pcp-4.3.1-1 pcp-4.3.1-2.fc28 pcp-4.3.1-2.fc29 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2019-03-17 07:20:27 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: | |||||||
Attachments: |
|
Description
Mark Goodwin
2019-01-04 05:45:08 UTC
Created attachment 1518312 [details]
cppcheck log whith --quiet removed
I don't think this is cppcheck bug and rather I think this is expected.
You can see what is occuring here with removing "--quiet" option as attached. Now lots of macros appears in the output lines.
As explained in "-D" or "-U" option of "$ man cppcheck", when cppcheck cannot find out header files and cannot determine if macros in the source file is defined or not, cppcheck tries to examine "all" the configurations (although Ι don't think cppcheck will check all the "combinations" of whether macros is defined or not) - when include directory is insufficient.
Here cppcheck cannot find out config.h because include directory is not specified, so cppcheck cannot find out whether HAVE_STAT_TIMESPEC or so is defined or not, then it tries to check all (perhaps actually some) macros combination pattern. And actually when HAVE_ST_MTIME_WITH_SPEC, HAVE_STAT_TIMESPEC_T, .... are all undefined, the source actually causes error.
Hi, thanks for the quick response. I agree the include directories should be specified with -I. That way cppcheck would at least have a chance to find the macros. The syntax error ("bozo!") is deliberate when none of the expected HAVE_.*TIME.* macros are defined, which is kind of like an assert in the code. One point of the BZ was that this used to work with cppcheck v1.85, but now fails with v1.86. Regardless, src/pmcd/src/GNUMakefile knows the correct -I directories to specify (${CFLAGS} and/or ${LCFLAGS}), so I guess it should specify those directories for cppcheck in the "make check" target. I'll investigate adding those flags in the PCP src tomorrow .. and report back. Regards Fixed upstream (and will be in pcp-4.3.1-1) by adding include paths to the cppcheck invocation. Mark Goodwin (1): build: add -I paths for cppcheck, fix travis-ci checking src/include/builddefs.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Details : commit c4388d3ee80bb14c96fe8eb46735abcfdc84606e (HEAD -> master, upstream-goodwinos/master) Author: Mark Goodwin <mgoodwin> Date: Sat Jan 5 08:43:17 2019 +1100 build: add -I paths for cppcheck, fix travis-ci checking RHBZ#1663372 - "pcp does not set include dir for cppcheck" Tweak the CPPCHECK definition in buildefs.in to specify some include paths, as recommended by the cppcheck maintainers in BZ1663372. modified: src/include/builddefs.in pcp-4.3.1-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-05aa494895 pcp-4.3.1-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2019-2f1f39ec7a pcp-4.3.1-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-2f1f39ec7a pcp-4.3.1-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-05aa494895 pcp-4.3.1-2.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-dc1a78c8d2 pcp-4.3.1-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2019-26d6a351e6 pcp-4.3.1-2.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-dc1a78c8d2 pcp-4.3.1-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-26d6a351e6 pcp-4.3.1-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report. pcp-4.3.1-2.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report. |