From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Ben Dooks <ben.dooks@codethink.co.uk>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 01/13] format-check: void * is not OK for strings, fix the test
Date: Wed, 14 Oct 2020 01:22:19 +0200 [thread overview]
Message-ID: <20201013232231.10349-2-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20201013232231.10349-1-luc.vanoostenryck@gmail.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
validation/varargs-format-addrspace1.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/validation/varargs-format-addrspace1.c b/validation/varargs-format-addrspace1.c
index 3370ac67849c..53c210b78ae0 100644
--- a/validation/varargs-format-addrspace1.c
+++ b/validation/varargs-format-addrspace1.c
@@ -4,8 +4,8 @@ extern int variadic2(char *msg, int , ...) __attribute__((format (printf, 1, 3))
extern int variadic3(int, char *msg, ...) __attribute__((format (printf, 2, 3)));
static void test(void) {
- void __attribute__((noderef, address_space(1))) *a;
- void *b;
+ const char __attribute__((noderef, address_space(1))) *a;
+ const char *b;
variadic("%s\n", a);
variadic("%s\n", b);
@@ -22,15 +22,15 @@ static void test(void) {
* check-error-start
varargs-format-addrspace1.c:10:26: warning: incorrect type in argument 2 (different address spaces)
varargs-format-addrspace1.c:10:26: expected char const *
-varargs-format-addrspace1.c:10:26: got void [noderef] <asn:1> *a
+varargs-format-addrspace1.c:10:26: got char const [noderef] <asn:1> *a
varargs-format-addrspace1.c:12:32: warning: incorrect type in argument 3 (different address spaces)
varargs-format-addrspace1.c:12:32: expected char const *
-varargs-format-addrspace1.c:12:32: got void [noderef] <asn:1> *a
+varargs-format-addrspace1.c:12:32: got char const [noderef] <asn:1> *a
varargs-format-addrspace1.c:13:36: warning: incorrect type in argument 4 (different address spaces)
varargs-format-addrspace1.c:13:36: expected char const *
-varargs-format-addrspace1.c:13:36: got void [noderef] <asn:1> *a
+varargs-format-addrspace1.c:13:36: got char const [noderef] <asn:1> *a
varargs-format-addrspace1.c:14:36: warning: incorrect type in argument 4 (different address spaces)
varargs-format-addrspace1.c:14:36: expected char const *
-varargs-format-addrspace1.c:14:36: got void [noderef] <asn:1> *a
+varargs-format-addrspace1.c:14:36: got char const [noderef] <asn:1> *a
* check-error-end
*/
--
2.28.0
next prev parent reply other threads:[~2020-10-14 9:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-13 23:22 [PATCH 00/13] format-check: add specific type checking Luc Van Oostenryck
2020-10-13 23:22 ` Luc Van Oostenryck [this message]
2020-10-13 23:22 ` [PATCH 02/13] format-check: more complete parsing of the length & type modifiers Luc Van Oostenryck
2020-10-13 23:22 ` [PATCH 03/13] format-check: add helper type_class() Luc Van Oostenryck
2020-10-13 23:22 ` [PATCH 04/13] format-check: merge 'fmt_string' & 'string' Luc Van Oostenryck
2020-10-13 23:22 ` [PATCH 05/13] format-check: remove unneeded member: target Luc Van Oostenryck
2020-10-13 23:22 ` [PATCH 06/13] format-check: add a function to check to type of strings Luc Van Oostenryck
2020-10-13 23:22 ` [PATCH 07/13] format-check: add a function to check to type of 'n' arguments Luc Van Oostenryck
2020-10-13 23:22 ` [PATCH 08/13] format-check: add a function to check to type of pointers Luc Van Oostenryck
2020-10-13 23:22 ` [PATCH 09/13] format-check: remove printf_fmt_print_pointer() Luc Van Oostenryck
2020-10-13 23:22 ` [PATCH 10/13] format-check: add a function to check the type of floats Luc Van Oostenryck
2020-10-13 23:22 ` [PATCH 11/13] format-check: add a function to check the type of integers Luc Van Oostenryck
2020-10-13 23:22 ` [PATCH 12/13] format-check: remove wrappers around type checking methods Luc Van Oostenryck
2020-10-13 23:22 ` [PATCH 13/13] format-check: simplify calling of parse_printf_get_fmt() Luc Van Oostenryck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201013232231.10349-2-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=ben.dooks@codethink.co.uk \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).