aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLance Richardson <lrichard@redhat.com>2016-09-21 10:13:58 -0400
committerChristopher Li <sparse@chrisli.org>2016-11-17 06:49:11 +0800
commitce18a906b82d0341cb33a71f7b1d8b98d11b345d (patch)
tree971ccc7e1b6001c9e4789af1907fa8b7bd9a7c72
parent1db3b627dfff5a6ab7a7af3259603eb0a10b45aa (diff)
downloadsparse-ce18a906b82d0341cb33a71f7b1d8b98d11b345d.tar.gz
sparse: update __builtin_object_size() prototypeHEADmaster
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> Acked-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index d5b56b01..2d66aa05 100644
--- a/lib.c
+++ b/lib.c
@@ -888,7 +888,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");