Re: Conditional dependencies
"Ian S. Nelson" <[email protected]> Wed, 14 Jul 2004 06:09:59 -0600
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
Is this a good time to mention that GCC 3.4 can do precompiled headers? You simply compile the .h files in to header.h.gch and then the compiler reads those, if they exist. I haven't put together any a-a-p code to build them yet, it seems like an additional path for the dependencies. Ian Bram Moolenaar wrote: >Lars Ivar Igesund wrote: > > > >>It struck me once that the dependencies found by ddepcheck wasn't >>necessarily correct at all times. This is due to the possibility to >>conditionally include/exclude parts of the source code using compiler >>switches. Correct dependencies for any given compilation run would >>therefore need ddepcheck to also look at these switches. I have >>implemented this (looks hairy at the moment) on my local copy of >>ddepcheck, but there is another problem that might, well, be a problem. >> >>If the switches are changed, changing the dependencies, but not the >>source code itself, can this be handled by A-A-P? I suppose dependency >>checking of C/C++ where includes are conditionally included/excluded by >>define might have the same problem. >> >> > >There are two ways to do the dependency checking: >1. Without looking at conditionals. Thus more files are found than what > is actually used. >2. Taking conditionals into account. Then the list of files is > accurate, but may change when the circumstances change. > >In the first case there are no tricks, no need to check the dependencies >again when you change conditionals. > >In the second case, the build signature should include the >circumstances. For C these are the preprocessor symbols. This should >already happen, since Aap uses a signature for the build commands. > >When an included file changes that may define different symbols, it's >more complicated. Example: > > file.c: > #include "defines.h" > #include "includes.h" > > defines.h: > #define ONE > // #define TWO > > includes.h: > #ifdef ONE > # include "one.h" > #endif > #ifdef TWO > # include "two.h" > #endif > >Depending on whether ONE and/or TWO are defined in defines.h, the >dependency of includes.h changes. But you can't see that when just >looking at includes.h. > >As it is when using gcc it will work correctly. It just verified that. >You always edit a file that's already one of the dependencies, thus Aap >will run the dependency checker. > >Perhaps there are situations where a change isn't noticed? > > > -- *Ian S. Nelson PGP/GPG email preferred. Public Key: 00D3D983 <http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x00D3D983> Fingerprint: 3EFD7B86B888D7E229B69E97576F1B9700D3D983 *
signature.asc
(application/pgp-signature, 253 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFA9SKYV28blwDT2YMRApKMAJ9cnYRySS0Aylpt8bmgrmAWu4Xb9ACeOooe jepOWZmjYvDXZV0ykvu5rpQ= =4ocI -----END PGP SIGNATURE-----