On Tue, 11 November 2008 16:00:21 -0500, Morten Welinder wrote:
> 
> The problem is not the header files, but that we need to ensure that the
> proper include path is set up.
> 
> This is needed because sparse currently tries to mimic some
> indeterminate gcc version in terms of predefines.  A similar solution
> would be needed to mimic any other compiler.  We obviously need
> a default path for system headers somehow.
> 
> In this case, we could probably get away with accepting a definition
> of GCC_INTERNAL_INCLUDE on the command line and use that in
> preference over whatever is in pre-process.h

That doesn't strike me as an improvement.  I have a workaround, which is
to create a symlink in /usr/lib/gcc/i486-linux-gnu/ that matches what
sparse expects.  If I had to set GCC_INTERNAL_INCLUDE on every
invocation, I'd consider that worse than my current workaround.

Either sparse gets smart enough to find the headers [1] or it ships its
own set.  Anything else will continue to fail on one machine or another.

[1] Bernd Petrovitsch sent me this neat one-liner in a private mail:
gcc -v -E - </dev/null 2>&1 >/dev/null | sed -n -e '/^#include <\.\.\.> search 
starts here:/,/^End of search list\./s/^ \(.*\)/\1/p

We could add that to cgcc to set additional include paths.

Jörn

-- 
Public Domain  - Free as in Beer
General Public - Free as in Speech
BSD License    - Free as in Enterprise
Shared Source  - Free as in "Work will make you..."



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to