On Wed, 21 Mar 2001, Ben A. Hetland wrote:

> 
> 
> Lars Clausen wrote:
>> 
>> bash-2.03$ find . -name \*.c | xargs grep \
>>            '# *include *["<]config\.h[">]' | wc -l
>>     161
>> 
> 
> We could of course also include the TAB in case that's used in some of
> the files, but this still doesn't check that the inclusion is done
> _first_, and besides...

I checked for the tabs (or rather, I checked that I get the same without
including the #).  I'll have to think a bit about the firstness... there,
only 8 files have that:

       ./app/render_gnomeprint.c
       ./app/render_dps_helper.c
       ./lib/font.c
       ./lib/charconv.c
       ./lib/ps
       ./objects/ER/entity.c
       ./objects/UML/class_dialog.c
       ./objects/standard/polycurve.c

I can fix those by hand.

>> It's a bloody mess.  Is it supposed to be <config.h> or "config.h"?  And
>> we're still missing 67 of them.
> 
> ...this still doesn't make much difference to your main point here,
> anyway.
> And we're down to only 67 now, which should be easy to locate...

In fact, I made a three-line shell script that fixed them all.  

> According to my ancient "ABC" on C that happened to be on my bookshelf
> nearby right now (I program mostly in C++ now, so C doc is sparse...), I
> "refreshed" my knowledge a little on this subject. It says on the
> subject <> vs "":
> 
> ""
> A search for the file is made first in the current directory and then in
> the standard places.
> 
> <>
> the preprocessor looks for the file only in the standard places and not
> in the current directory.
> 
> 
> ...but the standard might have updated itself many times after that ;-)

Interesting thing is that automake'd makefiles have -I., so they're
actually the same.  It's more a question of style, but

> However, this suggests that "" is the most inclusive form (and allows
> for even local versions in the sub-dirs, which might not be a good
> idea), so maybe this should be chosen?

...it might be good to show that it's not a per-directory include.  On the
other hand, I usually see <> as meaning system includes instead of includes
that come with the program.  James?

-Lars

-- 
Lars Clausen (http://shasta.cs.uiuc.edu/~lrclause) | Hårdgrim of Numenor
"I do not agree with a word that you say, but I    | Retainer of Sir Kegg
will defend to the death your right to say it."    |   of Westfield
    --Evelyn Beatrice Hall paraphrasing Voltaire   | Chaos Berserker of Khorne

Reply via email to