Bug 1114755
| Summary: | sparse seems unable to locate header files | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Vishal Verma <stellarhopper> |
| Component: | sparse | Assignee: | Jeff Layton <jlayton> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 20 | CC: | jlayton, stellarhopper |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-07-09 01:08:59 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
Vishal Verma
2014-06-30 21:35:29 UTC
I should note that this only started after gcc recently got updated to 4.8.3-1.fc20 Upstream sparse appears to work ok. I'm afraid that this is just a fundamental limitation in the way sparse currently works. It defaults to looking for gcc headers in the location given by -DGCC_BASE. Once gcc is upgraded, then that no longer works by default since the headers will have moved. The reason "upstream sparse" works for you is because you built it with gcc that's currently installed. If you changed your gcc version after building it, you'd hit the same problem.
It would be nice to have a proper fix for that sometime, but in the meantime you can use a command like this to work around it:
$ sparse -gcc-base-dir `gcc --print-file-name=` /tmp/test.c
...with that, your testcase doesn't throw that warning. It would be nice if sparse were able to determine that automatically, but for now it doesn't. Feel free to complain on the upstream sparse list however (and send patches if you're able to do so).
|