We scanned our firmware coreboot (See http://www.coreboot.org/) and it finds 11 analyzer failures. Complete logs are at http://www.coresystems.de/~patrick/scan-build-2009-01-09-1/ Please let me know if you need more information
the parser rejects are all reduced to this simple test case: struct foo bar; 'gcc -fsyntax-only' accepts this with *no warning* (weird..), while clang rejects it.
This is invalid code per C99 6.7p7. Note that, for example, -- extern struct foo bar; void *p = &bar; -- is legal and clang accepts this. Doug, you made a comment indicating you thought this was legal. It is true that if this was a legal declaration this would be a tentative definition, however my reading is that this isn't a legal declaration. Do you agree?
*** Bug 3349 has been marked as a duplicate of this bug. ***
(In reply to comment #1) > the parser rejects are all reduced to this simple test case: > > struct foo bar; > > 'gcc -fsyntax-only' accepts this with *no warning* (weird..), while clang > rejects it. I think you reduced that a bit too much... that's actually a bug in gcc's "-fsyntax-only". Try "gcc -S -o /dev/null" instead.
Proper reduced testcase: struct a x; struct a {int x;}; And as far as I can tell, this is actually legal; 6.7p7 doesn't apply here because x has linkage.
Should be fixed by: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090309/013735.html