From 07a9a950734c34be120491861647ace5a37d4c89 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 31 Oct 2012 21:59:50 +1030 Subject: [PATCH] talloc: remove const warning in _info example. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Compiler: /home/rusty/devel/cvs/ccan/ccan/talloc/_info: In function ‘main’: /home/rusty/devel/cvs/ccan/ccan/talloc/_info:84:9: warning: passing argument 2 of ‘open_output_cmd’ discards ‘const’ qualifier from pointer target type [enabled by default] /home/rusty/devel/cvs/ccan/ccan/talloc/_info:52:24: note: expected ‘char *’ but argument is of type ‘const char *’ Signed-off-by: Rusty Russell --- ccan/talloc/_info | 3 ++- ccan/tcon/test/compile_fail-tcon_cast.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ccan/talloc/_info b/ccan/talloc/_info index 9a189455..b229ba25 100644 --- a/ccan/talloc/_info +++ b/ccan/talloc/_info @@ -49,7 +49,8 @@ * } * * // This function opens a writable pipe to the given command. - * static struct command *open_output_cmd(const void *ctx, char *fmt, ...) + * static struct command *open_output_cmd(const void *ctx, + * const char *fmt, ...) * { * va_list ap; * struct command *cmd = talloc(ctx, struct command); diff --git a/ccan/tcon/test/compile_fail-tcon_cast.c b/ccan/tcon/test/compile_fail-tcon_cast.c index f80ef42c..3df0333c 100644 --- a/ccan/tcon/test/compile_fail-tcon_cast.c +++ b/ccan/tcon/test/compile_fail-tcon_cast.c @@ -25,5 +25,5 @@ int main(int argc, char *argv[]) icon.raw.p = NULL; x = tcon_cast(&icon, tc1, icon.raw.p); - return 0; + return x != NULL ? 0 : 1; } -- 2.39.2