[sparse] sparse: add patch to silence warnings about __builtin_va_arg_pack()

Jeff Layton jlayton at fedoraproject.org
Fri Jul 19 10:51:54 UTC 2013


commit 1965f7cf3a1f221463596bd9d72ba0bad9a525a9
Author: Jeff Layton <jlayton at redhat.com>
Date:   Fri Jul 19 06:50:29 2013 -0400

    sparse: add patch to silence warnings about __builtin_va_arg_pack()
    
    Signed-off-by: Jeff Layton <jlayton at redhat.com>

 ...__builtin_va_arg_pack-and-__builtin_va_ar.patch |   67 ++++++++++++++++++++
 sparse.spec                                        |    9 +++-
 2 files changed, 75 insertions(+), 1 deletions(-)
---
diff --git a/0001-sparse-add-__builtin_va_arg_pack-and-__builtin_va_ar.patch b/0001-sparse-add-__builtin_va_arg_pack-and-__builtin_va_ar.patch
new file mode 100644
index 0000000..545d63c
--- /dev/null
+++ b/0001-sparse-add-__builtin_va_arg_pack-and-__builtin_va_ar.patch
@@ -0,0 +1,67 @@
+From 46d00e8ca486bbae63f1b2b3a1170f5cab380f97 Mon Sep 17 00:00:00 2001
+From: Jeff Layton <jlayton at redhat.com>
+Date: Fri, 19 Jul 2013 06:25:33 -0400
+Subject: [PATCH v2] sparse: add __builtin_va_arg_pack() and
+ __builtin_va_arg_pack_len()
+
+this patch stops sparse from complaining about them not being defined:
+
+    /usr/include/bits/stdio2.h:98:25: error: undefined identifier '__builtin_va_arg_pack'
+    /usr/include/bits/stdio2.h:98:25: error: not a function <noident>
+
+Signed-off-by: Jeff Layton <jlayton at redhat.com>
+---
+ lib.c                            |  2 ++
+ validation/builtin_va_arg_pack.c | 20 ++++++++++++++++++++
+ 2 files changed, 22 insertions(+)
+ create mode 100644 validation/builtin_va_arg_pack.c
+
+diff --git a/lib.c b/lib.c
+index 7e822eb..3f687ae 100644
+--- a/lib.c
++++ b/lib.c
+@@ -777,6 +777,7 @@ void declare_builtin_functions(void)
+ 	add_pre_buffer("extern long __builtin_alpha_cmpbge(long, long);\n");
+ 	add_pre_buffer("extern long __builtin_labs(long);\n");
+ 	add_pre_buffer("extern double __builtin_fabs(double);\n");
++	add_pre_buffer("extern __SIZE_TYPE__ __builtin_va_arg_pack_len(void);\n");
+ 	add_pre_buffer("extern void __sync_synchronize();\n");
+ 	add_pre_buffer("extern int __sync_bool_compare_and_swap(void *, ...);\n");
+ 
+@@ -876,6 +877,7 @@ void create_builtin_stream(void)
+ 	add_pre_buffer("#define __builtin_va_copy(dest, src) ({ dest = src; (void)0; })\n");
+ 	add_pre_buffer("#define __builtin_va_end(arg)\n");
+ 	add_pre_buffer("#define __builtin_ms_va_end(arg)\n");
++	add_pre_buffer("#define __builtin_va_arg_pack()\n");
+ 
+ 	/* FIXME! We need to do these as special magic macros at expansion time! */
+ 	add_pre_buffer("#define __BASE_FILE__ \"base_file.c\"\n");
+diff --git a/validation/builtin_va_arg_pack.c b/validation/builtin_va_arg_pack.c
+new file mode 100644
+index 0000000..3426b86
+--- /dev/null
++++ b/validation/builtin_va_arg_pack.c
+@@ -0,0 +1,20 @@
++extern void v(int a, ...);
++
++extern inline __attribute__((__always_inline__)) void f(int a, ...)
++{
++	__SIZE_TYPE__ b = __builtin_va_arg_pack_len();
++}
++
++extern inline __attribute__((__always_inline__)) void g(int a, ...)
++{
++	v(a, __builtin_va_arg_pack());
++}
++
++static void h(void)
++{
++	f(0, 0);
++	g(0, 0);
++}
++/*
++ * check-name: __builtin_va_arg_pack()
++ */
+-- 
+1.8.3.1
+
diff --git a/sparse.spec b/sparse.spec
index e7e88e4..1051a21 100644
--- a/sparse.spec
+++ b/sparse.spec
@@ -1,6 +1,6 @@
 Name: sparse
 Version: 0.4.5.rc1
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary:    A semantic parser of source files
 Group:      Development/Tools
 License:    OSL 1.1
@@ -10,6 +10,8 @@ BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires: libxml2-devel gtk2-devel
 
+Patch1:     0001-sparse-add-__builtin_va_arg_pack-and-__builtin_va_ar.patch
+
 %description
 Sparse is a semantic parser of source files: it's neither a compiler
 (although it could be used as a front-end for one) nor is it a
@@ -37,6 +39,7 @@ Development headers headers and static lib for sparse-enabled apps
 
 %prep
 %setup -q
+%patch1 -p1
 
 %define make_destdir \
 make DESTDIR="%{buildroot}" PREFIX="%{_prefix}" \\\
@@ -81,6 +84,10 @@ make clean
 %{_libdir}/pkgconfig/%{name}.pc
 
 %changelog
+* Fri Jul 19 2013 Jeff Layton <jlayton at redhat.com> - 0.4.5.rc1-2
+- add test patch to silence warnings about __builtin_va_arg_pack() and
+  __builtin_va_arg_pack_len()
+
 * Tue Jul 09 2013 Jeff Layton <jlayton at redhat.com> - 0.4.5.rc1-1
 - update to upstream rc1 release
 


More information about the scm-commits mailing list