From: Lance Richardson <lrichard@redhat.com>
To: linux-sparse@vger.kernel.org
Subject: [PATCH] sparse: update __builtin_object_size() prototype
Date: Wed, 21 Sep 2016 10:13:58 -0400 [thread overview]
Message-ID: <1474467238-20939-1-git-send-email-lrichard@redhat.com> (raw)
Sparse emits a large number of warnings for the linux kernel source
tree of the form:
./arch/x86/include/asm/uaccess.h:735:18: \
warning: incorrect type in argument 1 (different modifiers)
./arch/x86/include/asm/uaccess.h:735:18: expected void *<noident>
./arch/x86/include/asm/uaccess.h:735:18: got void const *from
Fix by making the first parameter to __builtin_object_size()
type "const void *" instead of "void *", which is consistent with GCC
behavior (the prototype for this builtin in GCC documentation is evidently
incorrect).
Signed-off-by: Lance Richardson <lrichard@redhat.com>
---
lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib.c b/lib.c
index aa2af68..122dd6f 100644
--- a/lib.c
+++ b/lib.c
@@ -917,7 +917,7 @@ void declare_builtin_functions(void)
add_pre_buffer("extern long double __builtin_nanl(const char *);\n");
/* And some __FORTIFY_SOURCE ones.. */
- add_pre_buffer ("extern __SIZE_TYPE__ __builtin_object_size(void *, int);\n");
+ add_pre_buffer ("extern __SIZE_TYPE__ __builtin_object_size(const void *, int);\n");
add_pre_buffer ("extern void * __builtin___memcpy_chk(void *, const void *, __SIZE_TYPE__, __SIZE_TYPE__);\n");
add_pre_buffer ("extern void * __builtin___memmove_chk(void *, const void *, __SIZE_TYPE__, __SIZE_TYPE__);\n");
add_pre_buffer ("extern void * __builtin___mempcpy_chk(void *, const void *, __SIZE_TYPE__, __SIZE_TYPE__);\n");
--
2.5.5
next reply other threads:[~2016-09-21 14:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-21 14:13 Lance Richardson [this message]
2016-11-07 10:09 ` [PATCH] sparse: update __builtin_object_size() prototype Luc Van Oostenryck
2016-11-16 22:52 ` Christopher Li
2016-11-16 23:28 ` Luc Van Oostenryck
2016-11-17 8:28 ` Christopher Li
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=1474467238-20939-1-git-send-email-lrichard@redhat.com \
--to=lrichard@redhat.com \
--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).