It looks like many of the scan-build errors are because of missing defines. It doesn't look like scan-build is seeing settings.h. Would that be easy to fix? I think if we remove some of the noise it will be more useful.
Here's an example from: http://coresystems.de/~stepan/coreboot-scanbuild/tyan_s2892-scanbuild/failur...
/home/stepan/svn/scan-build/coreboot-v2//src/devices/pci_device.c:600:3: error: use of undeclared identifier 'MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID' printk_debug("%s subsystem <- %02x/%02x\n", ^ /home/stepan/svn/scan-build/coreboot-v2//src/devices/pci_device.c:602:4: note: instantiated from: MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, ^ /home/stepan/svn/scan-build/coreboot-v2//src/devices/pci_device.c:605:4: error: use of undeclared identifier 'MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID' MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, ^
Thanks, Myles
Am 21.04.2009 05:59, schrieb Myles Watson:
It looks like many of the scan-build errors are because of missing defines. It doesn't look like scan-build is seeing settings.h. Would that be easy to fix? I think if we remove some of the noise it will be more useful.
-include settings.h is a gcc extension to whatever standard to $CC commands lines there is. I'm aware of that, but don't have a solution handy right now. We have a couple of options: 1. special codepath for scan-build in the makefile (basically expanding settings.h into the command line again) 2. extend clang to know -include 3. pick the right set of include files in the coreboot tree so the entire build is covered, and include settings.h there.
1. means that there's another hack in the buildsystem, 2. means learning the clang codebase, 3. is quite volatile...
Oh, and there's 4. report in the clang issue tracker and wait for them to do it.
Patrick
On Tue, 21 Apr 2009 08:29:34 +0200, Patrick Georgi patrick.georgi@coresystems.de wrote:
Am 21.04.2009 05:59, schrieb Myles Watson:
It looks like many of the scan-build errors are because of missing defines. It doesn't look like scan-build is seeing settings.h. Would that be easy to fix? I think if we remove some of the noise it will be more useful.
-include settings.h is a gcc extension to whatever standard to $CC commands lines there is. I'm aware of that, but don't have a solution handy right now. We have a couple of options:
- special codepath for scan-build in the makefile (basically expanding
settings.h into the command line again) 2. extend clang to know -include 3. pick the right set of include files in the coreboot tree so the entire build is covered, and include settings.h there.
- means that there's another hack in the buildsystem, 2. means learning
the clang codebase, 3. is quite volatile...
Oh, and there's 4. report in the clang issue tracker and wait for them to do it.
It does make it kind of hard to sift through to find out what is really an error and what is just missing gcc extensions...
Am 21.04.2009 13:30, schrieb Joseph Smith:
It does make it kind of hard to sift through to find out what is really an error and what is just missing gcc extensions...
Stefan and I found a solution: scan-build happily prefers -include over --includes=, so I changed romcc to parse that, and the makefile to emit it (gcc knows -include, too) See patch.
Patrick
On Tue, 21 Apr 2009 14:23:18 +0200, Patrick Georgi patrick.georgi@coresystems.de wrote:
Am 21.04.2009 13:30, schrieb Joseph Smith:
It does make it kind of hard to sift through to find out what is really
an
error and what is just missing gcc extensions...
Stefan and I found a solution: scan-build happily prefers -include over --includes=, so I changed romcc to parse that, and the makefile to emit it (gcc knows -include, too) See patch.
Cool! As long as it doesn't break anything: Acked-by: Joseph Smith joe@settoplinux.org
Am 21.04.2009 14:33, schrieb Joseph Smith:
Cool! As long as it doesn't break anything:
I tried a romcc target and a CAR target, both with and without scan-build.
Acked-by: Joseph Smithjoe@settoplinux.org
Thanks, r4151
Patrick
On Tue, 21 Apr 2009 14:42:46 +0200, Patrick Georgi patrick.georgi@coresystems.de wrote:
Am 21.04.2009 14:33, schrieb Joseph Smith:
Cool! As long as it doesn't break anything:
I tried a romcc target and a CAR target, both with and without
scan-build.
Acked-by: Joseph Smithjoe@settoplinux.org
Thanks, r4151
Cool, when and where is the new post r4151 Scan-build?
On Tue, Apr 21, 2009 at 6:23 AM, Patrick Georgi patrick.georgi@coresystems.de wrote:
Am 21.04.2009 13:30, schrieb Joseph Smith:
It does make it kind of hard to sift through to find out what is really an error and what is just missing gcc extensions...
Stefan and I found a solution: scan-build happily prefers -include over --includes=, so I changed romcc to parse that, and the makefile to emit it (gcc knows -include, too) See patch.
Thanks for finding option # 5!
Myles