[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: nls.c and svn_nls.h (new files): insufficient #include statements

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-07-25 18:45:59 CEST

David James wrote:
> On 7/24/05, Julian Foad <julianfoad@btopenworld.com> wrote:
>
>>Done in r15403. I looked at some of our other files and noticed that they are
>>generally not including the header containing their prototypes before other
>>headers, so they are not verifying the lack of prerequisites for their headers.
>> Therefore I didn't make that a goal of this commit.
>
> Thanks for your work, Julian. If you notice any other headerfiles
> which are missing prerequisites, please carbon copy me on the email.

I'd be glad to assist you if I can, but, to be honest, when this next occurs,
probably in several months' time, and if it is me that first notices, I will
probably have forgotton who you were by then.

> In order to improve the SWIG bindings, I am working on a parser for
> these header files, and my parser breaks when dependencies are not
> included. Thanks for your work!

I can recommend the following method of checking whether a header file can
stand alone: try to compile it as if it were a C file. This is from my
"check-source.sh" script:

echo "Check that each header file includes what it needs."
for HEADER in subversion/include/*.h; do
   gcc -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -Wall
-Wundef -Wendif-labels -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-Wredundant-decls -Wnested-externs -g -Wmissing-declarations -pthread
-DNEON_ZLIB -DSVN_DEBUG -DAP_DEBUG -Wpointer-arith -Wwrite-strings -Wshadow
-I/usr/include/apache2 -I./subversion/include -I./subversion -I./neon/src
-I/usr/local/include/neon -I/home/julianfoad/build/subversion/apr/include
-I./apr/include -I/home/julianfoad/build/subversion/apr-util/include
-I./apr-util/include -o compiled-header.tmp -x c -c $HEADER
done

The option "-x c" is the one that tells GCC to treat the file as a C source
file despite its name.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 25 18:55:12 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.