[cfe-dev] Suggestion for improving #include error message

Renato Golin rengolin at systemcall.org
Thu Oct 29 05:53:44 PDT 2009


2009/10/29 Justin Johansson <procode at adam.com.au>:
> which was quite to be expected but this now prompts my suggestion that
> it would
> be even nicer if clang told me which directories it searched for the unfound
> include file "stdioz.h", i.e. if it displayed the include path.

Hi Justin,

As you, I'm a clang newbie, but IMHO, it's a bit too much.

The way to search for headers is pretty much standard, even when you
include directories of your own (via -I flag). I think that printing a
list of searched directories and possible matches would not only
clutter the output (console width problems comes to mind) but could
potentially misguide the user of the real problem.

However, there could be a separate tool, to find headers on your
system given your configuration and compilation options, which IDEs
could run upon "file not found" errors. Or maybe a '-vv' mode that
would print lots of warnings, debug information that IDEs could parse
and do intelligent stuff with it.

But making this the default is bad for raw console users. This is easy
for IDEs, but bad for the human eye.

A good example is when you try to get a template class and misplace
the template parameters. G++ will print all the candidates, and when
using std containers the list is horrendously long and wide.

My personal view is that "file not found" is sufficient... ;)

cheers,
--renato

Reclaim your digital rights, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm



More information about the cfe-dev mailing list