On Tue May 08 18:44:52 2007, infinoid wrote: > Just talking to myself here :) > > On Tue May 08 13:28:41 2007, mark <!-- x --> at glines.org wrote: > > Hmm. It seems there's more than one header being missed by > > t/codingstd/c_header_guards.t. I'm going to try to supplement the > > $DIST->c_header_files() list with items culled from > > $DIST->generated_files(), or something, if noone can come up with a > > better idea. > > I've done this, and I also fixed a bug preventing the test from > detecting two header files using the same guard-macro name. > > Here's a cumulative patch, please consider applying this instead of the > previous diffs I attached to this ticket. > > The patch: > > * Fixes the collision check, in c_header_guards.t > * Adds some logic to c_header_guards.t to sift through the > $DIST->generated_files() list, looking for additional header files not > returned by ->c_header_files() (but only checks files which exist in the > current tree) > * skips the redundancy check for include/parrot/platform.h, because that > header contains verbatim copies of other header files (with their own > guards) > * fixes a guard collision between src/jit/skeleton/jit_emit.h and > src/jit/ppc/jit_emit.h > * fix generated guards in include/parrot/vtable.h, > include/parrot/oplib/ops.h, include/parrot/platform.h, > include/parrot/feature.h > * add guards to code to generate src/string_private_cstring.h, > include/parrot/oplib/core_ops.h, include/parrot/core_pmcs.h, > include/parrot/has_header.h, > * add a comment to another #endif in the generated > include/parrot/vtable.h, which was 52 lines away from its #ifdef > * add a "do not edit this file, its autogenerated" comment to the top of > the generated include/parrot/platform.h > > After this, c_header_guards.t detects conflicting guard-names in a > couple of places where header files are copied from one subdirectory to > another, which I might be able to filter out with a whitelist, or maybe > just compare their md5sums. But otherwise, I'm done for a while, I > promise :) > > Mark
Applied in revisions: 18484--18488; thanks! I changed the output generated when tests fail slightly and TODO'ed the identical header guard test until we have a decent way to check for copied header files. Some C languages files are exempted from the coding standards tests and you might want to do a similar thing here with the C headers. Have a look at is_c_exemption() in lib/Parrot/ Distribution.pm (and the file in general). One nit: the changes to the test should really have been a separate patch. Thanks for your hard work! Paul