ccanlint: fix usage of unused main parameters in other cases where we add main() Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools/ccanlint: add args to main. This allows examples to refer to them, but we cast them to void at the end to avoid -Wunused warnings. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools/ccanlint: compile cleanly with -Wextra. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccanlint: Add cflags support to _info
tools: manifest.c should use path_canon. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: use tal/path instead of writing own path handlers. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: use tal instead of talloc. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccanlint: handle nested modules when mentioned in examples. If we see an ccan include line in an example, we add that to the dependencies to try to build the example, but we didn't handle nested modules. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: don't assume modules are immediately below ccan/ dir. Removing this assumption should allow nested modules. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: enhance get_libs to get libraries for tests, too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: add testdepends handling in _info. This allows us to separate dependencies only needed for testing. This matters: they don't have the same impact on licensing, nor necessarily on end-users. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccanlint: add #line directives to examples. This means error messages come out in the right place. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccanlint: make sure examples get correct -l options. We intuit the dependencies of embedded examples by looking for #include. But these extra dependencies may require extra libraries, so we need to add those, too.
ccanlint: recurse to get -l options. If a dependent module needs -l options, we don't notice. Fix that, now we have one.
tools: more intelligent caching for compile _info. We let the get_deps() caller hand us the compiled _info filename, but what about recursive dependencies? These we re-generate every time. So fix this: hand a generator callback to get_deps(), expose the one which simply compiles it, and add a ccanlint one which looks up the manifest to see if we have one already. Before: $ ccanlint -vvvv ccan/failtest | grep -c 'Creating.*_info' 31 After: $ ccanlint -vvvv ccan/failtest | grep -c 'Creating.*_info' 17
ccanlint: remove argument to -k/--keep It's much easier to simply say "keep all", and it simplifies the code quite a bit.
ccanlint: get rid of separate class of compulsory tests. It's reduced to a flag which means we stop processing the module. We have to enhance our dependencies a bit, but they've always been quite good. This simplifies things quite a bit.
ccanlint: more tweaks to example mangling. Note where previous analysis said the code was outside a function, and fix double new-line. Also, treat end of comment as end of statement.
ccanlint: keep separate array of compiled versions. Rather than mug the old ->compiled version when we reduce features, keep both in the structure. This makes it clear that we are using the right version (we weren't in all cases, in particular we weren't recompiling the test helpers correctly.
ccanlint: rename obj_list in examples_compile.c to example_obj_list. Trivial cleanup, but differentiates from the general obj_list used elsewhere.