[ccan] [PATCH] ccan: Correct some poor conventions in _info includes

David Gibson david at gibson.dropbear.id.au
Mon Jun 16 00:09:09 EST 2014


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 at gibson.dropbear.id.au>
---
 ccan/alignof/_info                 | 2 +-
 ccan/antithread/_info              | 2 +-
 ccan/antithread/alloc/_info        | 2 +-
 ccan/argcheck/_info                | 2 ++
 ccan/array_size/_info              | 2 +-
 ccan/asearch/_info                 | 2 +-
 ccan/asort/_info                   | 1 +
 ccan/asprintf/_info                | 3 ++-
 ccan/autodata/_info                | 3 ++-
 ccan/avl/_info                     | 3 ++-
 ccan/bdelta/_info                  | 3 ++-
 ccan/bitmap/_info                  | 3 ++-
 ccan/block_pool/_info              | 2 +-
 ccan/breakpoint/_info              | 3 ++-
 ccan/btree/_info                   | 3 ++-
 ccan/build_assert/_info            | 2 +-
 ccan/bytestring/_info              | 1 +
 ccan/cast/_info                    | 3 ++-
 ccan/ccan_tokenizer/_info          | 2 +-
 ccan/charset/_info                 | 2 +-
 ccan/check_type/_info              | 2 +-
 ccan/ciniparser/_info              | 2 +-
 ccan/compiler/_info                | 2 +-
 ccan/container_of/_info            | 2 +-
 ccan/cpuid/_info                   | 4 ++++
 ccan/crc/_info                     | 1 +
 ccan/crcsync/_info                 | 2 +-
 ccan/daemon_with_notify/_info      | 2 +-
 ccan/daemonize/_info               | 2 +-
 ccan/darray/_info                  | 3 ++-
 ccan/dgraph/_info                  | 1 +
 ccan/endian/_info                  | 2 +-
 ccan/err/_info                     | 2 +-
 ccan/failtest/_info                | 2 +-
 ccan/grab_file/_info               | 2 +-
 ccan/hash/_info                    | 1 +
 ccan/heap/_info                    | 3 ++-
 ccan/htable/_info                  | 1 +
 ccan/idtree/_info                  | 2 +-
 ccan/ilog/_info                    | 2 +-
 ccan/io/_info                      | 2 +-
 ccan/isaac/_info                   | 2 +-
 ccan/iscsi/_info                   | 1 +
 ccan/jacobson_karels/_info         | 3 ++-
 ccan/jmap/_info                    | 2 +-
 ccan/jset/_info                    | 2 +-
 ccan/json/_info                    | 3 ++-
 ccan/lbalance/_info                | 1 +
 ccan/likely/_info                  | 2 +-
 ccan/list/_info                    | 2 +-
 ccan/md4/_info                     | 2 +-
 ccan/minmax/_info                  | 3 ++-
 ccan/net/_info                     | 3 ++-
 ccan/nfs/_info                     | 1 +
 ccan/noerr/_info                   | 2 +-
 ccan/objset/_info                  | 3 ++-
 ccan/ogg_to_pcm/_info              | 2 +-
 ccan/opt/_info                     | 2 +-
 ccan/ptr_valid/_info               | 3 ++-
 ccan/rbtree/_info                  | 1 +
 ccan/rbuf/_info                    | 3 ++-
 ccan/read_write_all/_info          | 2 +-
 ccan/short_types/_info             | 2 +-
 ccan/siphash/_info                 | 2 +-
 ccan/sparse_bsearch/_info          | 2 +-
 ccan/str/_info                     | 2 +-
 ccan/stringmap/_info               | 2 +-
 ccan/strmap/_info                  | 3 ++-
 ccan/strset/_info                  | 3 ++-
 ccan/take/_info                    | 3 ++-
 ccan/tal/_info                     | 2 +-
 ccan/tal/grab_file/_info           | 2 +-
 ccan/tal/link/_info                | 2 +-
 ccan/tal/path/_info                | 3 ++-
 ccan/tal/str/_info                 | 2 +-
 ccan/tal/talloc/_info              | 2 +-
 ccan/talloc/_info                  | 2 +-
 ccan/tally/_info                   | 2 +-
 ccan/tap/_info                     | 2 +-
 ccan/tcon/_info                    | 1 +
 ccan/time/_info                    | 3 ++-
 ccan/timer/_info                   | 3 ++-
 ccan/tlist/_info                   | 2 +-
 ccan/ttxml/_info                   | 3 ++-
 ccan/typesafe_cb/_info             | 2 +-
 ccan/version/_info                 | 3 ++-
 ccan/wwviaudio/_info               | 2 +-
 tools/ccanlint/tests/info_exists.c | 3 ++-
 88 files changed, 118 insertions(+), 75 deletions(-)

diff --git a/ccan/alignof/_info b/ccan/alignof/_info
index 7eca1f2..e0952c6 100644
--- a/ccan/alignof/_info
+++ b/ccan/alignof/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * alignof - ALIGNOF() macro to determine alignment of a type.
diff --git a/ccan/antithread/_info b/ccan/antithread/_info
index ba6de00..7bde201 100644
--- a/ccan/antithread/_info
+++ b/ccan/antithread/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * antithread - Accelerated Native Technology Implementation of "threads"
diff --git a/ccan/antithread/alloc/_info b/ccan/antithread/alloc/_info
index 5ad1800..bf4756e 100644
--- a/ccan/antithread/alloc/_info
+++ b/ccan/antithread/alloc/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * antithread/alloc - memory allocator routines
diff --git a/ccan/argcheck/_info b/ccan/argcheck/_info
index 620ff83..f8b37c2 100644
--- a/ccan/argcheck/_info
+++ b/ccan/argcheck/_info
@@ -1,4 +1,6 @@
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * argcheck - macros to check arguments at runtime
diff --git a/ccan/array_size/_info b/ccan/array_size/_info
index d670042..b8a9a85 100644
--- a/ccan/array_size/_info
+++ b/ccan/array_size/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * array_size - routine for safely deriving the size of a visible array.
diff --git a/ccan/asearch/_info b/ccan/asearch/_info
index 35282c4..fae6e4a 100644
--- a/ccan/asearch/_info
+++ b/ccan/asearch/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * asearch - typesafe binary search (bsearch)
diff --git a/ccan/asort/_info b/ccan/asort/_info
index 2d3e66e..57523cc 100644
--- a/ccan/asort/_info
+++ b/ccan/asort/_info
@@ -1,3 +1,4 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
 
diff --git a/ccan/asprintf/_info b/ccan/asprintf/_info
index 1aa5d34..f72d668 100644
--- a/ccan/asprintf/_info
+++ b/ccan/asprintf/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * asprintf - asprintf wrapper (and if necessary, implementation).
diff --git a/ccan/autodata/_info b/ccan/autodata/_info
index c9cf266..a101276 100644
--- a/ccan/autodata/_info
+++ b/ccan/autodata/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * autodata - stash pointers in your binary for automatic registration
diff --git a/ccan/avl/_info b/ccan/avl/_info
index 94b3d2e..83893dd 100644
--- a/ccan/avl/_info
+++ b/ccan/avl/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * avl - Key-value dictionary based on AVL trees
diff --git a/ccan/bdelta/_info b/ccan/bdelta/_info
index 8b1135a..75d6556 100644
--- a/ccan/bdelta/_info
+++ b/ccan/bdelta/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * bdelta - Generate and apply binary deltas
diff --git a/ccan/bitmap/_info b/ccan/bitmap/_info
index 2038058..b8d297d 100644
--- a/ccan/bitmap/_info
+++ b/ccan/bitmap/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * bitmap - bitmap handling
diff --git a/ccan/block_pool/_info b/ccan/block_pool/_info
index d89da5b..a42cdba 100644
--- a/ccan/block_pool/_info
+++ b/ccan/block_pool/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * block_pool - An efficient allocator for blocks that don't need to be resized or freed.
diff --git a/ccan/breakpoint/_info b/ccan/breakpoint/_info
index 5f5251e..272ee25 100644
--- a/ccan/breakpoint/_info
+++ b/ccan/breakpoint/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * breakpoint - break if the program is run under gdb.
diff --git a/ccan/btree/_info b/ccan/btree/_info
index e5f2313..7a69ed9 100644
--- a/ccan/btree/_info
+++ b/ccan/btree/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * btree - Efficient sorted associative container based on B-trees.
diff --git a/ccan/build_assert/_info b/ccan/build_assert/_info
index bce92b7..97ebe6c 100644
--- a/ccan/build_assert/_info
+++ b/ccan/build_assert/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * build_assert - routines for build-time assertions
diff --git a/ccan/bytestring/_info b/ccan/bytestring/_info
index 5b08491..32de954 100644
--- a/ccan/bytestring/_info
+++ b/ccan/bytestring/_info
@@ -1,3 +1,4 @@
+#include <stdio.h>
 #include <string.h>
 #include "config.h"
 
diff --git a/ccan/cast/_info b/ccan/cast/_info
index d66e709..f5cd37f 100644
--- a/ccan/cast/_info
+++ b/ccan/cast/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * cast - routines for safer casting.
diff --git a/ccan/ccan_tokenizer/_info b/ccan/ccan_tokenizer/_info
index ad01cea..aef90fb 100644
--- a/ccan/ccan_tokenizer/_info
+++ b/ccan/ccan_tokenizer/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <string.h>
 #include <stdio.h>
-#include "config.h"
 
 /**
  * ccan_tokenizer - A full-text lexer for C source files
diff --git a/ccan/charset/_info b/ccan/charset/_info
index e07d704..aa0193d 100644
--- a/ccan/charset/_info
+++ b/ccan/charset/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * charset - character set conversion and validation routines
diff --git a/ccan/check_type/_info b/ccan/check_type/_info
index cb19e20..cc42673 100644
--- a/ccan/check_type/_info
+++ b/ccan/check_type/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * check_type - routines for compile time type checking
diff --git a/ccan/ciniparser/_info b/ccan/ciniparser/_info
index c252257..749a455 100644
--- a/ccan/ciniparser/_info
+++ b/ccan/ciniparser/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * ciniparser - easily parse and manipulate ini style configuration files
diff --git a/ccan/compiler/_info b/ccan/compiler/_info
index fc9318f..d60dff4 100644
--- a/ccan/compiler/_info
+++ b/ccan/compiler/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <string.h>
 #include <stdio.h>
-#include "config.h"
 
 /**
  * compiler - macros for common compiler extensions
diff --git a/ccan/container_of/_info b/ccan/container_of/_info
index 77b3bd1..d50094b 100644
--- a/ccan/container_of/_info
+++ b/ccan/container_of/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * container_of - routine for upcasting
diff --git a/ccan/cpuid/_info b/ccan/cpuid/_info
index 79a98c0..5699a2c 100644
--- a/ccan/cpuid/_info
+++ b/ccan/cpuid/_info
@@ -1,3 +1,7 @@
+#include "config.h"
+#include <stdio.h>
+#include <string.h>
+
 #include "cpuid.h"
 
 /**
diff --git a/ccan/crc/_info b/ccan/crc/_info
index 3511b8e..c59d58e 100644
--- a/ccan/crc/_info
+++ b/ccan/crc/_info
@@ -1,3 +1,4 @@
+#include "config.h"
 #include <string.h>
 #include <stdio.h>
 
diff --git a/ccan/crcsync/_info b/ccan/crcsync/_info
index e6d5178..9ebb8bd 100644
--- a/ccan/crcsync/_info
+++ b/ccan/crcsync/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * crcsync - routines to use crc for an rsync-like protocol.
diff --git a/ccan/daemon_with_notify/_info b/ccan/daemon_with_notify/_info
index be72b91..cb53a3e 100644
--- a/ccan/daemon_with_notify/_info
+++ b/ccan/daemon_with_notify/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * daemon_with_notify - daemonize a process, can wait for child to signal readiness
diff --git a/ccan/daemonize/_info b/ccan/daemonize/_info
index f0e55bc..0c4bc98 100644
--- a/ccan/daemonize/_info
+++ b/ccan/daemonize/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * daemonize - routine to turn a process into a well-behaved daemon.
diff --git a/ccan/darray/_info b/ccan/darray/_info
index 8be9a78..b6d5e4b 100644
--- a/ccan/darray/_info
+++ b/ccan/darray/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 #include "ccan/darray/darray.h"
 
diff --git a/ccan/dgraph/_info b/ccan/dgraph/_info
index 10c8296..81a75a7 100644
--- a/ccan/dgraph/_info
+++ b/ccan/dgraph/_info
@@ -1,4 +1,5 @@
 #include "config.h"
+#include <stdio.h>
 #include <string.h>
 
 /**
diff --git a/ccan/endian/_info b/ccan/endian/_info
index a71b9ae..efe5a8b 100644
--- a/ccan/endian/_info
+++ b/ccan/endian/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * endian - endian conversion macros for simple types
diff --git a/ccan/err/_info b/ccan/err/_info
index 64cc2ce..2af2066 100644
--- a/ccan/err/_info
+++ b/ccan/err/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * err - err(), errx(), warn() and warnx(), as per BSD's err.h.
diff --git a/ccan/failtest/_info b/ccan/failtest/_info
index ca2b60e..87569f9 100644
--- a/ccan/failtest/_info
+++ b/ccan/failtest/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * failtest - unit test helpers for testing malloc and other failures.
diff --git a/ccan/grab_file/_info b/ccan/grab_file/_info
index 1db4c29..2508a2e 100644
--- a/ccan/grab_file/_info
+++ b/ccan/grab_file/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * grab_file - file helper routines
diff --git a/ccan/hash/_info b/ccan/hash/_info
index d975452..bbb3685 100644
--- a/ccan/hash/_info
+++ b/ccan/hash/_info
@@ -1,3 +1,4 @@
+#include "config.h"
 #include <string.h>
 #include <stdio.h>
 
diff --git a/ccan/heap/_info b/ccan/heap/_info
index 552b139..fe5866d 100644
--- a/ccan/heap/_info
+++ b/ccan/heap/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * heap - a simple heap implementation
diff --git a/ccan/htable/_info b/ccan/htable/_info
index 1553da2..7e06c38 100644
--- a/ccan/htable/_info
+++ b/ccan/htable/_info
@@ -1,3 +1,4 @@
+#include "config.h"
 #include <string.h>
 #include <stdio.h>
 
diff --git a/ccan/idtree/_info b/ccan/idtree/_info
index 664e7cf..cc0c09e 100644
--- a/ccan/idtree/_info
+++ b/ccan/idtree/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * idtree - id allocation tree
diff --git a/ccan/ilog/_info b/ccan/ilog/_info
index d57c05d..f1f3f2d 100644
--- a/ccan/ilog/_info
+++ b/ccan/ilog/_info
@@ -35,9 +35,9 @@
  * License: CC0 (Public domain)
  * Author: Timothy B. Terriberry <tterribe at xiph.org>
  */
+#include "config.h"
 #include <string.h>
 #include <stdio.h>
-#include "config.h"
 
 int main(int _argc,const char *_argv[]){
   /*Expect exactly one argument.*/
diff --git a/ccan/io/_info b/ccan/io/_info
index 8f5c2ad..0ba46a6 100644
--- a/ccan/io/_info
+++ b/ccan/io/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * io - simple library for asynchronous io handling.
diff --git a/ccan/isaac/_info b/ccan/isaac/_info
index 81c6ff2..c0e25ee 100644
--- a/ccan/isaac/_info
+++ b/ccan/isaac/_info
@@ -104,9 +104,9 @@
  *	// We actually depend on the LGPL ilog routines, so not PD :(
  *	license_depends_compat FAIL
  */
+#include "config.h"
 #include <string.h>
 #include <stdio.h>
-#include "config.h"
 
 int main(int _argc,const char *_argv[]){
   /*Expect exactly one argument.*/
diff --git a/ccan/iscsi/_info b/ccan/iscsi/_info
index f75f2c2..5257703 100644
--- a/ccan/iscsi/_info
+++ b/ccan/iscsi/_info
@@ -1,3 +1,4 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
 
diff --git a/ccan/jacobson_karels/_info b/ccan/jacobson_karels/_info
index 9165470..a066f46 100644
--- a/ccan/jacobson_karels/_info
+++ b/ccan/jacobson_karels/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * jacobson_karels - Jacobson/Karels Round Trip Time algorithm
diff --git a/ccan/jmap/_info b/ccan/jmap/_info
index 966a51a..739e60a 100644
--- a/ccan/jmap/_info
+++ b/ccan/jmap/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * jmap - map from indices to values (based on libJudy)
diff --git a/ccan/jset/_info b/ccan/jset/_info
index 6ff928f..b6759ec 100644
--- a/ccan/jset/_info
+++ b/ccan/jset/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * jset - set of pointers (based on libJudy)
diff --git a/ccan/json/_info b/ccan/json/_info
index 0544cf5..3113b63 100644
--- a/ccan/json/_info
+++ b/ccan/json/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * json - Parse and generate JSON (JavaScript Object Notation)
diff --git a/ccan/lbalance/_info b/ccan/lbalance/_info
index 2121ed2..7524e54 100644
--- a/ccan/lbalance/_info
+++ b/ccan/lbalance/_info
@@ -1,5 +1,6 @@
 /* Licensed under GPLv3+ - see LICENSE file for details */
 #include "config.h"
+#include <stdio.h>
 #include <string.h>
 
 /**
diff --git a/ccan/likely/_info b/ccan/likely/_info
index b6885ef..095ed2f 100644
--- a/ccan/likely/_info
+++ b/ccan/likely/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <string.h>
 #include <stdio.h>
-#include "config.h"
 
 /**
  * likely - macros for annotating likely/unlikely branches in the code
diff --git a/ccan/list/_info b/ccan/list/_info
index 75e3837..60790a9 100644
--- a/ccan/list/_info
+++ b/ccan/list/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * list - double linked list routines
diff --git a/ccan/md4/_info b/ccan/md4/_info
index 6c6f9d8..4ccdddf 100644
--- a/ccan/md4/_info
+++ b/ccan/md4/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * md4 - MD4 Message Digest Algorithm (RFC1320).
diff --git a/ccan/minmax/_info b/ccan/minmax/_info
index 1490ba4..4d95336 100644
--- a/ccan/minmax/_info
+++ b/ccan/minmax/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * minmax - typesafe minimum and maximum functions
diff --git a/ccan/net/_info b/ccan/net/_info
index b4b219f..5ac83f9 100644
--- a/ccan/net/_info
+++ b/ccan/net/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * net - simple IPv4/IPv6 socket library
diff --git a/ccan/nfs/_info b/ccan/nfs/_info
index 412c8dd..0efc047 100644
--- a/ccan/nfs/_info
+++ b/ccan/nfs/_info
@@ -1,3 +1,4 @@
+#include "config.h"
 #include <string.h>
 #include <stdio.h>
 
diff --git a/ccan/noerr/_info b/ccan/noerr/_info
index ebc407d..082c71e 100644
--- a/ccan/noerr/_info
+++ b/ccan/noerr/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * noerr - routines for cleaning up without blatting errno
diff --git a/ccan/objset/_info b/ccan/objset/_info
index cf29028..5831f58 100644
--- a/ccan/objset/_info
+++ b/ccan/objset/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * objset - unordered set of pointers.
diff --git a/ccan/ogg_to_pcm/_info b/ccan/ogg_to_pcm/_info
index c987b22..d48a5f9 100644
--- a/ccan/ogg_to_pcm/_info
+++ b/ccan/ogg_to_pcm/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * ogg_to_pcm - decode ogg vorbis audio files to PCM data using libvorbis 
diff --git a/ccan/opt/_info b/ccan/opt/_info
index 9d47c48..1039620 100644
--- a/ccan/opt/_info
+++ b/ccan/opt/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * opt - simple command line parsing
diff --git a/ccan/ptr_valid/_info b/ccan/ptr_valid/_info
index b577535..91c9abd 100644
--- a/ccan/ptr_valid/_info
+++ b/ccan/ptr_valid/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * ptr_valid - test whether a pointer is safe to dereference.
diff --git a/ccan/rbtree/_info b/ccan/rbtree/_info
index 58afa05..7d314a0 100644
--- a/ccan/rbtree/_info
+++ b/ccan/rbtree/_info
@@ -1,3 +1,4 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
 
diff --git a/ccan/rbuf/_info b/ccan/rbuf/_info
index 30232db..7c9224d 100644
--- a/ccan/rbuf/_info
+++ b/ccan/rbuf/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * rbuf - buffered I/O input primitive.
diff --git a/ccan/read_write_all/_info b/ccan/read_write_all/_info
index d70cbd1..20c5e84 100644
--- a/ccan/read_write_all/_info
+++ b/ccan/read_write_all/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * read_write_all - read_all and write_all routines.
diff --git a/ccan/short_types/_info b/ccan/short_types/_info
index f324e35..909e4e3 100644
--- a/ccan/short_types/_info
+++ b/ccan/short_types/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * short_types - shorter names for standard integer types
diff --git a/ccan/siphash/_info b/ccan/siphash/_info
index e6d518a..d42ddab 100644
--- a/ccan/siphash/_info
+++ b/ccan/siphash/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * siphash - a keyed hash function
diff --git a/ccan/sparse_bsearch/_info b/ccan/sparse_bsearch/_info
index a2b77c1..eb1e735 100644
--- a/ccan/sparse_bsearch/_info
+++ b/ccan/sparse_bsearch/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <string.h>
 #include <stdio.h>
-#include "config.h"
 
 /**
  * sparse_bsearch - search a sorted array with some invalid entries
diff --git a/ccan/str/_info b/ccan/str/_info
index 548f059..251d999 100644
--- a/ccan/str/_info
+++ b/ccan/str/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * str - string helper routines
diff --git a/ccan/stringmap/_info b/ccan/stringmap/_info
index 49eff19..1f6465b 100644
--- a/ccan/stringmap/_info
+++ b/ccan/stringmap/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * stringmap - Macros for mapping strings to things
diff --git a/ccan/strmap/_info b/ccan/strmap/_info
index 6d03b0c..33176b3 100644
--- a/ccan/strmap/_info
+++ b/ccan/strmap/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * strmap - an ordered map of strings to values
diff --git a/ccan/strset/_info b/ccan/strset/_info
index 4984959..3f4f773 100644
--- a/ccan/strset/_info
+++ b/ccan/strset/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * strset - an ordered set of strings
diff --git a/ccan/take/_info b/ccan/take/_info
index 34b0886..a3ac539 100644
--- a/ccan/take/_info
+++ b/ccan/take/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * take - routines to mark pointers to be consumed by called functions.
diff --git a/ccan/tal/_info b/ccan/tal/_info
index 0d75f56..890cb2e 100644
--- a/ccan/tal/_info
+++ b/ccan/tal/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * tal - compact tree allocator routines (inspired by talloc)
diff --git a/ccan/tal/grab_file/_info b/ccan/tal/grab_file/_info
index 3b323d3..68ad089 100644
--- a/ccan/tal/grab_file/_info
+++ b/ccan/tal/grab_file/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * tal/grab_file - file helper routines
diff --git a/ccan/tal/link/_info b/ccan/tal/link/_info
index d128e01..6962cb4 100644
--- a/ccan/tal/link/_info
+++ b/ccan/tal/link/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * tal/link - link helper for tal
diff --git a/ccan/tal/path/_info b/ccan/tal/path/_info
index 24b9e46..22fcbcc 100644
--- a/ccan/tal/path/_info
+++ b/ccan/tal/path/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * tal/path - routines to manipulate paths
diff --git a/ccan/tal/str/_info b/ccan/tal/str/_info
index 381dd98..6fd94dc 100644
--- a/ccan/tal/str/_info
+++ b/ccan/tal/str/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * tal/str - string helper routines which use tal
diff --git a/ccan/tal/talloc/_info b/ccan/tal/talloc/_info
index 9b1544d..00241aa 100644
--- a/ccan/tal/talloc/_info
+++ b/ccan/tal/talloc/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * tal/talloc - an implementation of the tal interface in terms of talloc.
diff --git a/ccan/talloc/_info b/ccan/talloc/_info
index 0ae45e7..182299e 100644
--- a/ccan/talloc/_info
+++ b/ccan/talloc/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * talloc - tree allocator routines
diff --git a/ccan/tally/_info b/ccan/tally/_info
index 6dab9b7..c75897c 100644
--- a/ccan/tally/_info
+++ b/ccan/tally/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * tally - running tally of integers
diff --git a/ccan/tap/_info b/ccan/tap/_info
index baea996..2b116de 100644
--- a/ccan/tap/_info
+++ b/ccan/tap/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * tap - Test Anything Protocol
diff --git a/ccan/tcon/_info b/ccan/tcon/_info
index 895da9e..c07e41e 100644
--- a/ccan/tcon/_info
+++ b/ccan/tcon/_info
@@ -1,4 +1,5 @@
 #include "config.h"
+#include <stdio.h>
 #include <string.h>
 
 /**
diff --git a/ccan/time/_info b/ccan/time/_info
index 5cf20f7..ae410a7 100644
--- a/ccan/time/_info
+++ b/ccan/time/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * time - routines for dealing with time
diff --git a/ccan/timer/_info b/ccan/timer/_info
index 580b115..4c58d9e 100644
--- a/ccan/timer/_info
+++ b/ccan/timer/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * timer - efficient implementation of rarely-expiring timers.
diff --git a/ccan/tlist/_info b/ccan/tlist/_info
index e18e2ef..e6b16ef 100644
--- a/ccan/tlist/_info
+++ b/ccan/tlist/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * tlist - typesafe double linked list routines
diff --git a/ccan/ttxml/_info b/ccan/ttxml/_info
index 3ec4520..266a734 100644
--- a/ccan/ttxml/_info
+++ b/ccan/ttxml/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * ttxml - tiny XML library for parsing (trusted!) XML documents.
diff --git a/ccan/typesafe_cb/_info b/ccan/typesafe_cb/_info
index 4485aec..165852a 100644
--- a/ccan/typesafe_cb/_info
+++ b/ccan/typesafe_cb/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * typesafe_cb - macros for safe callbacks.
diff --git a/ccan/version/_info b/ccan/version/_info
index 3aad1e8..ccdcbdb 100644
--- a/ccan/version/_info
+++ b/ccan/version/_info
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * version - helper functions for major.minor-style version numbers
diff --git a/ccan/wwviaudio/_info b/ccan/wwviaudio/_info
index ba92f8f..5fb6beb 100644
--- a/ccan/wwviaudio/_info
+++ b/ccan/wwviaudio/_info
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * wwviaudio - realtime playback and mixing of 16 bit signed PCM audio data.
diff --git a/tools/ccanlint/tests/info_exists.c b/tools/ccanlint/tests/info_exists.c
index 86101aa..9f6f206 100644
--- a/tools/ccanlint/tests/info_exists.c
+++ b/tools/ccanlint/tests/info_exists.c
@@ -31,8 +31,9 @@ static void check_has_info(struct manifest *m,
 }
 
 static const char template[] =
-	"#include <string.h>\n"
 	"#include \"config.h\"\n"
+	"#include <stdio.h>\n"
+	"#include <string.h>\n"
 	"\n"
 	"/**\n"
 	" * %s - YOUR-ONE-LINE-DESCRIPTION-HERE\n"
-- 
1.9.3



More information about the ccan mailing list