From patchwork Wed Sep 21 14:13:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Richardson X-Patchwork-Id: 9343653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 736C2601C2 for ; Wed, 21 Sep 2016 14:14:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 642282A6E5 for ; Wed, 21 Sep 2016 14:14:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 585882A6EC; Wed, 21 Sep 2016 14:14:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB0242A70F for ; Wed, 21 Sep 2016 14:14:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756677AbcIUOOA (ORCPT ); Wed, 21 Sep 2016 10:14:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33068 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756627AbcIUON7 (ORCPT ); Wed, 21 Sep 2016 10:13:59 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 739E9C04B93F for ; Wed, 21 Sep 2016 14:13:59 +0000 (UTC) Received: from thinkcentre.nc.rr.com (vpn-54-57.rdu2.redhat.com [10.10.54.57]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8LEDwBe001640 for ; Wed, 21 Sep 2016 10:13:59 -0400 From: Lance Richardson To: linux-sparse@vger.kernel.org Subject: [PATCH] sparse: update __builtin_object_size() prototype Date: Wed, 21 Sep 2016 10:13:58 -0400 Message-Id: <1474467238-20939-1-git-send-email-lrichard@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 21 Sep 2016 14:13:59 +0000 (UTC) Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 * ./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 Acked-by: Luc Van Oostenryck --- 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");