ccanlint: Move ccanlint test options from _info comments to code Currently, _info files can specify options, or note expected failures, for ccanlint checks in the _info file with specially structured comments. That differs from most other things ccanlint gets from _info, where it instead executes the info file with certain parameters. This changes ccanlint and existing _info files to use the normal method for the ccanlint test options as well. This also has the advantage that an info file can alter its test options based on things from config.h - in some cases whether a test can work or not might depend on various things. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan: Correct some poor conventions in _info includes There are a couple of small problems with the includes used in most of ccan's _info files. * _info routinely uses printf(), and so should include <stdio.h>, but only some of them do. We get away with it, because they do include <string.h>, which apparently includes <stdio.h> indirectly, but we should be explicit about it. * Most _info files were including config.h after the system headers. That _seems_ sensible, but actually causes problems. Because config.h defines _GNU_SOURCE it can change the behaviour of the system headers. More specifically it can make them behave differently to how the individual module headers (which have included config.h) expects them to behave. This patch adjusts all the existing _info files and, more importantly, the template constructed by ccanlint. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
crcsync: fix memory leak in tests. /home/rusty/devel/cvs/ccan/ccan/crcsync/test/run-crash.c:==6923== 112 bytes in 1 blocks are definitely lost in loss record 2 of 3 ==6923== at 0x402BA7A: malloc (vg_replace_malloc.c:261) ==6923== by 0x80492EE: crcblocks (run-crash.c:20) ==6923== by 0x8049448: main (run-crash.c:62) ==6923== 2,217 (2,212 direct, 5 indirect) bytes in 1 blocks are definitely lost in loss record 3 of 3 ==6923== at 0x402BA7A: malloc (vg_replace_malloc.c:261) ==6923== by 0x8048AA0: crc_context_new (crcsync.c:85) ==6923== by 0x8049476: main (run-crash.c:64) /home/rusty/devel/cvs/ccan/ccan/crcsync/test/run.c:==11793== 512 bytes in 1 blocks are definitely lost in loss record 1 of 2 ==11793== at 0x402A52B: calloc (vg_replace_malloc.c:462) ==11793== by 0x8049A3F: main (run.c:128) ==11793== 512 bytes in 1 blocks are definitely lost in loss record 2 of 2 ==11793== at 0x402A52B: calloc (vg_replace_malloc.c:462) ==11793== by 0x8049A57: main (run.c:129) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
crcsync: fix constness warning. /home/rusty/devel/cvs/ccan/ccan/crcsync/test/run-crash.c:Compile gave warnings: /home/rusty/devel/cvs/ccan/ccan/crcsync/test/run-crash.c: In function ‘main’: /home/rusty/devel/cvs/ccan/ccan/crcsync/test/run-crash.c:30:3: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default] /home/rusty/devel/cvs/ccan/ccan/crcsync/test/run-crash.c:35:3: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default] Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
isaac, crcsync: acknowledge licensing issues. The recently added ccanlint licensing checks revealed several cases where the published license of a module is misleading: a dependency of that module has a stricter license (eg. a public domain module which depends on a GPL one). Where these are my modules, I've fixed them. Otherwise I'm overriding the checks for the moment, and asking the authors what they want to do.
various: make the _info License: wording uniform for GPL variants. GPL versions 2 and 3 both specifically mention "any later version" as the phrase which allows the user to choose to upgrade the license. Make sure we use that phrase, and make the format consistent across modules.
Convert to 64 bit crcs: change semantics of crcbits field to be *upper* not *lower* bits.