[Pkg-samba-maint] [samba] 01/02: Add patch gcc_6.patch, fixing compatibility with gcc 6. Closes: #812264

Jelmer Vernooij jelmer at moszumanska.debian.org
Mon Jul 4 13:34:10 UTC 2016


This is an automated email from the git hooks/post-receive script.

jelmer pushed a commit to branch master
in repository samba.

commit e23b11c3bccb7e463ffb51c86f3321cca63d57a9
Author: Jelmer Vernooij <jelmer at jelmer.uk>
Date:   Mon Jul 4 12:23:25 2016 +0000

    Add patch gcc_6.patch, fixing compatibility with gcc 6. Closes: #812264
---
 buildtools/wafsamba/wscript               |  16 +++
 debian/changelog                          |   7 +
 debian/patches/gcc_6.patch                | 212 ++++++++++++++++++++++++++++++
 debian/patches/series                     |   1 +
 lib/replace/replace.h                     |   4 +-
 lib/tevent/tevent.h                       |   2 +-
 lib/util/attr.h                           |  16 +--
 source3/modules/getdate.c                 |   2 +-
 source3/modules/getdate.y                 |   2 +-
 source3/rpc_server/mdssvc/sparql_parser.c |   4 +-
 source4/lib/wmi/wmi_wrap.c                |   8 +-
 third_party/zlib/zlib.h                   |   2 +-
 12 files changed, 252 insertions(+), 24 deletions(-)

diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index 9e437e3..ad5bb0c 100755
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -401,6 +401,22 @@ def configure(conf):
             addmain=False,
             msg='Checking for library destructor support')
 
+    conf.CHECK_CODE('''
+            void test_attribute(void) __attribute__ (());
+
+            void test_attribute(void)
+            {
+                return;
+            }
+
+            int main(void) {
+                return 0;
+            }
+            ''',
+            'HAVE___ATTRIBUTE__',
+            addmain=False,
+            msg='Checking for __attribute__')
+
     if sys.platform.startswith('aix'):
         conf.DEFINE('_ALL_SOURCE', 1, add_to_cflags=True)
         # Might not be needed if ALL_SOURCE is defined
diff --git a/debian/changelog b/debian/changelog
index 02eaf36..06b215c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+samba (2:4.4.4+dfsg-3) UNRELEASED; urgency=medium
+
+  * Add patch gcc_6.patch, fixing compatibility with gcc 6.
+    Closes: #812264
+
+ -- Jelmer Vernooij <jelmer at debian.org>  Mon, 04 Jul 2016 12:20:56 +0000
+
 samba (2:4.4.4+dfsg-2) unstable; urgency=medium
 
   * Mask samba-ad-dc.service unless needed (Closes: #828137)
diff --git a/debian/patches/gcc_6.patch b/debian/patches/gcc_6.patch
new file mode 100644
index 0000000..6b56b05
--- /dev/null
+++ b/debian/patches/gcc_6.patch
@@ -0,0 +1,212 @@
+Description: Compatibility fixes for gcc-6
+Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812264
+Status: cherry-picked from upstream
+
+diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
+index 9e437e3..ad5bb0c 100755
+--- a/buildtools/wafsamba/wscript
++++ b/buildtools/wafsamba/wscript
+@@ -401,6 +401,22 @@ def configure(conf):
+             addmain=False,
+             msg='Checking for library destructor support')
+ 
++    conf.CHECK_CODE('''
++            void test_attribute(void) __attribute__ (());
++
++            void test_attribute(void)
++            {
++                return;
++            }
++
++            int main(void) {
++                return 0;
++            }
++            ''',
++            'HAVE___ATTRIBUTE__',
++            addmain=False,
++            msg='Checking for __attribute__')
++
+     if sys.platform.startswith('aix'):
+         conf.DEFINE('_ALL_SOURCE', 1, add_to_cflags=True)
+         # Might not be needed if ALL_SOURCE is defined
+diff --git a/lib/replace/replace.h b/lib/replace/replace.h
+index c764d06..7080373 100644
+--- a/lib/replace/replace.h
++++ b/lib/replace/replace.h
+@@ -425,7 +425,7 @@ int rep_dlclose(void *handle);
+ #endif
+ 
+ #ifndef PRINTF_ATTRIBUTE
+-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
++#ifdef HAVE___ATTRIBUTE__
+ /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
+  * the parameter containing the format, and a2 the index of the first
+  * argument. Note that some gcc 2.x versions don't handle this
+@@ -437,7 +437,7 @@ int rep_dlclose(void *handle);
+ #endif
+ 
+ #ifndef _DEPRECATED_
+-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
++#ifdef HAVE___ATTRIBUTE__
+ #define _DEPRECATED_ __attribute__ ((deprecated))
+ #else
+ #define _DEPRECATED_
+diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
+index cb95507..cc6b15e 100644
+--- a/lib/tevent/tevent.h
++++ b/lib/tevent/tevent.h
+@@ -1752,7 +1752,7 @@ void tevent_thread_proxy_schedule(struct tevent_thread_proxy *tp,
+ 
+ #ifdef TEVENT_DEPRECATED
+ #ifndef _DEPRECATED_
+-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
++#ifdef HAVE___ATTRIBUTE__
+ #define _DEPRECATED_ __attribute__ ((deprecated))
+ #else
+ #define _DEPRECATED_
+diff --git a/lib/util/attr.h b/lib/util/attr.h
+index b72696a..8e542c1 100644
+--- a/lib/util/attr.h
++++ b/lib/util/attr.h
+@@ -35,7 +35,7 @@
+ #endif
+ 
+ #ifndef _DEPRECATED_
+-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
++#ifdef HAVE___ATTRIBUTE__
+ #define _DEPRECATED_ __attribute__ ((deprecated))
+ #else
+ #define _DEPRECATED_
+@@ -43,7 +43,7 @@
+ #endif
+ 
+ #ifndef _WARN_UNUSED_RESULT_
+-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
++#ifdef HAVE___ATTRIBUTE__
+ #define _WARN_UNUSED_RESULT_ __attribute__ ((warn_unused_result))
+ #else
+ #define _WARN_UNUSED_RESULT_
+@@ -51,7 +51,7 @@
+ #endif
+ 
+ #ifndef _NORETURN_
+-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
++#ifdef HAVE___ATTRIBUTE__
+ #define _NORETURN_ __attribute__ ((noreturn))
+ #else
+ #define _NORETURN_
+@@ -59,7 +59,7 @@
+ #endif
+ 
+ #ifndef _PURE_
+-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
++#ifdef HAVE___ATTRIBUTE__
+ #define _PURE_ __attribute__((pure))
+ #else
+ #define _PURE_
+@@ -67,7 +67,7 @@
+ #endif
+ 
+ #ifndef NONNULL
+-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
++#ifdef HAVE___ATTRIBUTE__
+ #define NONNULL(param) param __attribute__((nonnull))
+ #else
+ #define NONNULL(param) param
+@@ -75,7 +75,7 @@
+ #endif
+ 
+ #ifndef PRINTF_ATTRIBUTE
+-#if __GNUC__ >= 3
++#ifdef HAVE___ATTRIBUTE__
+ /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
+  * the parameter containing the format, and a2 the index of the first
+  * argument. Note that some gcc 2.x versions don't handle this
+@@ -87,11 +87,11 @@
+ #endif
+ 
+ #ifndef FORMAT_ATTRIBUTE
+-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
++#ifdef HAVE___ATTRIBUTE__
+ /** Use gcc attribute to check printf fns.  a1 is argument to format()
+  * in the above macro.  This is needed to support Heimdal's printf
+  * decorations. Note that some gcc 2.x versions don't handle this
+- * properly, and as such I've used the same minimum from heimdal: GCC 3.1 **/
++ * properly. **/
+ #define FORMAT_ATTRIBUTE(a) __attribute__ ((format a))
+ #else
+ #define FORMAT_ATTRIBUTE(a)
+diff --git a/source3/modules/getdate.c b/source3/modules/getdate.c
+index a27b75f..6ed9946 100644
+--- a/source3/modules/getdate.c
++++ b/source3/modules/getdate.c
+@@ -181,7 +181,7 @@
+ # include <string.h>
+ #endif
+ 
+-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
++#ifndef HAVE___ATTRIBUTE__
+ # define __attribute__(x)
+ #endif
+ 
+diff --git a/source3/modules/getdate.y b/source3/modules/getdate.y
+index 21c01b8..1ddcda4 100644
+--- a/source3/modules/getdate.y
++++ b/source3/modules/getdate.y
+@@ -72,7 +72,7 @@
+ # include <string.h>
+ #endif
+ 
+-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
++#ifndef HAVE___ATTRIBUTE__
+ # define __attribute__(x)
+ #endif
+ 
+diff --git a/source3/rpc_server/mdssvc/sparql_parser.c b/source3/rpc_server/mdssvc/sparql_parser.c
+index 8170290..3cd532b 100644
+--- a/source3/rpc_server/mdssvc/sparql_parser.c
++++ b/source3/rpc_server/mdssvc/sparql_parser.c
+@@ -241,9 +241,7 @@ typedef short int yytype_int16;
+ #endif
+ 
+ #ifndef YY_ATTRIBUTE
+-# if (defined __GNUC__                                               \
+-      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
+-     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
++# if HAVE___ATTRIBUTE__
+ #  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+ # else
+ #  define YY_ATTRIBUTE(Spec) /* empty */
+diff --git a/source4/lib/wmi/wmi_wrap.c b/source4/lib/wmi/wmi_wrap.c
+index a4aaf1b..07eba3e 100644
+--- a/source4/lib/wmi/wmi_wrap.c
++++ b/source4/lib/wmi/wmi_wrap.c
+@@ -39,13 +39,7 @@
+ 
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
+ #ifndef SWIGUNUSED
+-# if defined(__GNUC__)
+-#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+-#     define SWIGUNUSED __attribute__ ((__unused__)) 
+-#   else
+-#     define SWIGUNUSED
+-#   endif
+-# elif defined(__ICC)
++# ifdef HAVE___ATTRIBUTE__
+ #   define SWIGUNUSED __attribute__ ((__unused__)) 
+ # else
+ #   define SWIGUNUSED 
+diff --git a/third_party/zlib/zlib.h b/third_party/zlib/zlib.h
+index aa7f082..a303d77 100644
+--- a/third_party/zlib/zlib.h
++++ b/third_party/zlib/zlib.h
+@@ -213,7 +213,7 @@ typedef gz_header FAR *gz_headerp;
+ #define zlib_version zlibVersion()
+ /* for compatibility with versions < 1.0.2 */
+ 
+-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
++#ifdef HAVE___ATTRIBUTE__
+ /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
+  * the parameter containing the format, and a2 the index of the first
+  * argument. Note that some gcc 2.x versions don't handle this
diff --git a/debian/patches/series b/debian/patches/series
index 70227fc..1eb1132 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -18,3 +18,4 @@ Skip-raw.write-tests.patch
 systemd-syslog.target-is-obsolete.patch
 Add-documentation-to-systemd-Unit-files.patch
 fix_kill_path_in_units.patch
+gcc_6.patch
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index c764d06..7080373 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -425,7 +425,7 @@ int rep_dlclose(void *handle);
 #endif
 
 #ifndef PRINTF_ATTRIBUTE
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#ifdef HAVE___ATTRIBUTE__
 /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
  * the parameter containing the format, and a2 the index of the first
  * argument. Note that some gcc 2.x versions don't handle this
@@ -437,7 +437,7 @@ int rep_dlclose(void *handle);
 #endif
 
 #ifndef _DEPRECATED_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#ifdef HAVE___ATTRIBUTE__
 #define _DEPRECATED_ __attribute__ ((deprecated))
 #else
 #define _DEPRECATED_
diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
index cb95507..cc6b15e 100644
--- a/lib/tevent/tevent.h
+++ b/lib/tevent/tevent.h
@@ -1752,7 +1752,7 @@ void tevent_thread_proxy_schedule(struct tevent_thread_proxy *tp,
 
 #ifdef TEVENT_DEPRECATED
 #ifndef _DEPRECATED_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#ifdef HAVE___ATTRIBUTE__
 #define _DEPRECATED_ __attribute__ ((deprecated))
 #else
 #define _DEPRECATED_
diff --git a/lib/util/attr.h b/lib/util/attr.h
index b72696a..8e542c1 100644
--- a/lib/util/attr.h
+++ b/lib/util/attr.h
@@ -35,7 +35,7 @@
 #endif
 
 #ifndef _DEPRECATED_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#ifdef HAVE___ATTRIBUTE__
 #define _DEPRECATED_ __attribute__ ((deprecated))
 #else
 #define _DEPRECATED_
@@ -43,7 +43,7 @@
 #endif
 
 #ifndef _WARN_UNUSED_RESULT_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#ifdef HAVE___ATTRIBUTE__
 #define _WARN_UNUSED_RESULT_ __attribute__ ((warn_unused_result))
 #else
 #define _WARN_UNUSED_RESULT_
@@ -51,7 +51,7 @@
 #endif
 
 #ifndef _NORETURN_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#ifdef HAVE___ATTRIBUTE__
 #define _NORETURN_ __attribute__ ((noreturn))
 #else
 #define _NORETURN_
@@ -59,7 +59,7 @@
 #endif
 
 #ifndef _PURE_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
+#ifdef HAVE___ATTRIBUTE__
 #define _PURE_ __attribute__((pure))
 #else
 #define _PURE_
@@ -67,7 +67,7 @@
 #endif
 
 #ifndef NONNULL
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
+#ifdef HAVE___ATTRIBUTE__
 #define NONNULL(param) param __attribute__((nonnull))
 #else
 #define NONNULL(param) param
@@ -75,7 +75,7 @@
 #endif
 
 #ifndef PRINTF_ATTRIBUTE
-#if __GNUC__ >= 3
+#ifdef HAVE___ATTRIBUTE__
 /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
  * the parameter containing the format, and a2 the index of the first
  * argument. Note that some gcc 2.x versions don't handle this
@@ -87,11 +87,11 @@
 #endif
 
 #ifndef FORMAT_ATTRIBUTE
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#ifdef HAVE___ATTRIBUTE__
 /** Use gcc attribute to check printf fns.  a1 is argument to format()
  * in the above macro.  This is needed to support Heimdal's printf
  * decorations. Note that some gcc 2.x versions don't handle this
- * properly, and as such I've used the same minimum from heimdal: GCC 3.1 **/
+ * properly. **/
 #define FORMAT_ATTRIBUTE(a) __attribute__ ((format a))
 #else
 #define FORMAT_ATTRIBUTE(a)
diff --git a/source3/modules/getdate.c b/source3/modules/getdate.c
index a27b75f..6ed9946 100644
--- a/source3/modules/getdate.c
+++ b/source3/modules/getdate.c
@@ -181,7 +181,7 @@
 # include <string.h>
 #endif
 
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
+#ifndef HAVE___ATTRIBUTE__
 # define __attribute__(x)
 #endif
 
diff --git a/source3/modules/getdate.y b/source3/modules/getdate.y
index 21c01b8..1ddcda4 100644
--- a/source3/modules/getdate.y
+++ b/source3/modules/getdate.y
@@ -72,7 +72,7 @@
 # include <string.h>
 #endif
 
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
+#ifndef HAVE___ATTRIBUTE__
 # define __attribute__(x)
 #endif
 
diff --git a/source3/rpc_server/mdssvc/sparql_parser.c b/source3/rpc_server/mdssvc/sparql_parser.c
index 8170290..3cd532b 100644
--- a/source3/rpc_server/mdssvc/sparql_parser.c
+++ b/source3/rpc_server/mdssvc/sparql_parser.c
@@ -241,9 +241,7 @@ typedef short int yytype_int16;
 #endif
 
 #ifndef YY_ATTRIBUTE
-# if (defined __GNUC__                                               \
-      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
-     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+# if HAVE___ATTRIBUTE__
 #  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
 # else
 #  define YY_ATTRIBUTE(Spec) /* empty */
diff --git a/source4/lib/wmi/wmi_wrap.c b/source4/lib/wmi/wmi_wrap.c
index a4aaf1b..07eba3e 100644
--- a/source4/lib/wmi/wmi_wrap.c
+++ b/source4/lib/wmi/wmi_wrap.c
@@ -39,13 +39,7 @@
 
 /* attribute recognised by some compilers to avoid 'unused' warnings */
 #ifndef SWIGUNUSED
-# if defined(__GNUC__)
-#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-#     define SWIGUNUSED __attribute__ ((__unused__)) 
-#   else
-#     define SWIGUNUSED
-#   endif
-# elif defined(__ICC)
+# ifdef HAVE___ATTRIBUTE__
 #   define SWIGUNUSED __attribute__ ((__unused__)) 
 # else
 #   define SWIGUNUSED 
diff --git a/third_party/zlib/zlib.h b/third_party/zlib/zlib.h
index aa7f082..a303d77 100644
--- a/third_party/zlib/zlib.h
+++ b/third_party/zlib/zlib.h
@@ -213,7 +213,7 @@ typedef gz_header FAR *gz_headerp;
 #define zlib_version zlibVersion()
 /* for compatibility with versions < 1.0.2 */
 
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
+#ifdef HAVE___ATTRIBUTE__
 /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
  * the parameter containing the format, and a2 the index of the first
  * argument. Note that some gcc 2.x versions don't handle this

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-samba/samba.git




More information about the Pkg-samba-maint mailing list