[cfe-dev] fatal error: 'cstdio' file not found

David Chisnall theraven at sucs.org
Sun Jul 18 03:04:12 PDT 2010

On 17 Jul 2010, at 17:47, Alexei Svitkine wrote:

> That would make the clang binary non-portable to other systems (which
> may have different GCC versions).

The same is true of GCC - the binary is not portable to systems with different locations for the standard headers.  

> I'd rather have this detection be done at clang start time. I really
> don't think it would have any significant performance penalty (I'm
> guessing the code that tries to find header files would need to do a
> bunch of file ops anyway to go through the hardcoded list of paths -
> so if that hard-coded list was shorter because we'd add the right
> thing to it at start time, we'd save doing all that other work later
> on).

Unfortunately, you seem to be assuming that every system looks like yours.  The locations for the standard headers are not the same on other platforms - as Clark points out, some put the headers in /usr/lib/gcc/{target tripple}, while others put them in other random places.  Darwin also needs to look in /System/Library/Frameworks and /Library/Frameworks, for example.

Picking up what the system compiler uses in configure would allow clang to work as a drop-in replacement for the system compiler, without needing a huge mess of hard-coded 'standard' locations.  


This email complies with ISO 3103

More information about the cfe-dev mailing list