[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[glibc] 01/02: debian/patches/git-updates.diff: update from upstream stable branch.



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

aurel32 pushed a commit to branch glibc-2.25
in repository glibc.

commit d504c8daf671876b132c29282ca0b9495f61bcc8
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sat Aug 26 11:03:35 2017 +0200

    debian/patches/git-updates.diff: update from upstream stable branch.
---
 debian/changelog                |   1 +
 debian/patches/git-updates.diff | 177 +++++++++++++++++++++++++++++++++++++---
 2 files changed, 166 insertions(+), 12 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1e9ae5f..b9d4eb2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ glibc (2.25-0experimental2) UNRELEASED; urgency=medium
   * debian/debhelper.in/libc-dev{-alt,}.install: install libm*.a to also
     installed the versioned static library on architectures with mvec support.
     Closes: #872852.
+  * debian/patches/git-updates.diff: update from upstream stable branch.
 
  -- Aurelien Jarno <aurel32@debian.org>  Sun, 20 Aug 2017 19:05:48 +0200
 
diff --git a/debian/patches/git-updates.diff b/debian/patches/git-updates.diff
index 854508b..fe337be 100644
--- a/debian/patches/git-updates.diff
+++ b/debian/patches/git-updates.diff
@@ -1,10 +1,21 @@
 GIT update of git://sourceware.org/git/glibc.git/release/2.25/master from glibc-2.25
 
 diff --git a/ChangeLog b/ChangeLog
-index f140ee67de..2bb46f4462 100644
+index f140ee67de..de780da83c 100644
 --- a/ChangeLog
 +++ b/ChangeLog
-@@ -1,3 +1,381 @@
+@@ -1,3 +1,392 @@
++2017-08-21  Florian Weimer  <fweimer@redhat.com>
++
++	[BZ #21972]
++	* assert/assert.h (assert): Use static_cast (bool) for C++.
++	Use the ternary operator in the warning branch for GNU C.
++	* assert/Makefile (tests): Add tst-assert-c++, tst-assert-g++.
++	(CFLAGS-tst-assert-c++.o): Compile in C++11 mode.
++	(CFLAGS-tst-assert-g++.o): Compile in GnU C++11 mode.
++	(LDLIBS-tst-assert-c++, LDLIBS-tst-assert-g++): Link with libstdc++.
++	* assert/tst-assert-c++.cc, assert/tst-assert-g++.cc: New files.
++
 +2017-04-13  Florian Weimer  <fweimer@redhat.com>
 +
 +	[BZ #21361]
@@ -456,10 +467,10 @@ index e9194e54cf..7f0eef8096 100644
  	| sed -n -f $< > $@.new
  	test -s $@.new
 diff --git a/NEWS b/NEWS
-index ec15dde761..a2435ccc81 100644
+index ec15dde761..6abe9022a7 100644
 --- a/NEWS
 +++ b/NEWS
-@@ -5,6 +5,25 @@ See the end for copying conditions.
+@@ -5,6 +5,26 @@ See the end for copying conditions.
  Please send GNU C library bug reports via <http://sourceware.org/bugzilla/>
  using `glibc' in the "product" field.
  
@@ -481,27 +492,60 @@ index ec15dde761..a2435ccc81 100644
 +  [21289] Fix symbol redirect for fts_set
 +  [21386] Assertion in fork for distinct parent PID is incorrect
 +  [21624] Unsafe alloca allows local attackers to alias stack and heap (CVE-2017-1000366)
++  [21972] assert macro requires operator== (int) for its argument type
 +
  Version 2.25
  
  * The feature test macro __STDC_WANT_LIB_EXT2__, from ISO/IEC TR
+diff --git a/assert/Makefile b/assert/Makefile
+index 1c3be9b01f..9ec1be81a9 100644
+--- a/assert/Makefile
++++ b/assert/Makefile
+@@ -25,6 +25,15 @@ include ../Makeconfig
+ headers	:= assert.h
+ 
+ routines := assert assert-perr __assert
+-tests := test-assert test-assert-perr
++tests := test-assert test-assert-perr tst-assert-c++ tst-assert-g++
+ 
+ include ../Rules
++
++ifeq ($(have-cxx-thread_local),yes)
++CFLAGS-tst-assert-c++.o = -std=c++11
++LDLIBS-tst-assert-c++ = -lstdc++
++CFLAGS-tst-assert-g++.o = -std=gnu++11
++LDLIBS-tst-assert-g++ = -lstdc++
++else
++tests-unsupported += tst-assert-c++ tst-assert-g++
++endif
 diff --git a/assert/assert.h b/assert/assert.h
-index 22f019537c..6801cfeb10 100644
+index 22f019537c..640c95c063 100644
 --- a/assert/assert.h
 +++ b/assert/assert.h
-@@ -91,13 +91,19 @@ __END_DECLS
+@@ -85,19 +85,29 @@ __END_DECLS
+ /* When possible, define assert so that it does not add extra
+    parentheses around EXPR.  Otherwise, those added parentheses would
+    suppress warnings we'd expect to be detected by gcc's -Wparentheses.  */
+-# if !defined __GNUC__ || defined __STRICT_ANSI__
++# if defined __cplusplus
++#  define assert(expr)							\
++     (static_cast <bool> (expr)						\
++      ? void (0)							\
++      : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
++# elif !defined __GNUC__ || defined __STRICT_ANSI__
+ #  define assert(expr)							\
+     ((expr)								\
       ? __ASSERT_VOID_CAST (0)						\
       : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
  # else
 +/* The first occurrence of EXPR is not evaluated due to the sizeof,
 +   but will trigger any pedantic warnings masked by the __extension__
-+   for the second occurrence.  The explicit comparison against zero is
-+   required to support function pointers and bit fields in this
-+   context, and to suppress the evaluation of variable length
-+   arrays.  */
++   for the second occurrence.  The ternary operator is required to
++   support function pointers and bit fields in this context, and to
++   suppress the evaluation of variable length arrays.  */
  #  define assert(expr)							\
 -    ({									\
-+  ((void) sizeof ((expr) == 0), __extension__ ({			\
++  ((void) sizeof ((expr) ? 1 : 0), __extension__ ({			\
        if (expr)								\
          ; /* empty */							\
        else								\
@@ -511,7 +555,7 @@ index 22f019537c..6801cfeb10 100644
  # endif
  
  # ifdef	__USE_GNU
-@@ -113,7 +119,7 @@ __END_DECLS
+@@ -113,7 +123,7 @@ __END_DECLS
     C9x has a similar variable called __func__, but prefer the GCC one since
     it demangles C++ function names.  */
  # if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
@@ -520,6 +564,115 @@ index 22f019537c..6801cfeb10 100644
  # else
  #  if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
  #   define __ASSERT_FUNCTION	__func__
+diff --git a/assert/tst-assert-c++.cc b/assert/tst-assert-c++.cc
+new file mode 100644
+index 0000000000..12a5e690cb
+--- /dev/null
++++ b/assert/tst-assert-c++.cc
+@@ -0,0 +1,78 @@
++/* Tests for interactions between C++ and assert.
++   Copyright (C) 2017 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <http://www.gnu.org/licenses/>.  */
++
++#include <assert.h>
++
++/* The C++ standard requires that if the assert argument is a constant
++   subexpression, then the assert itself is one, too.  */
++constexpr int
++check_constexpr ()
++{
++  return (assert (true), 1);
++}
++
++/* Objects of this class can be contextually converted to bool, but
++   cannot be compared to int.  */
++struct no_int
++{
++  no_int () = default;
++  no_int (const no_int &) = delete;
++
++  explicit operator bool () const
++  {
++    return true;
++  }
++
++  bool operator! () const; /* No definition.  */
++  template <class T> bool operator== (T) const; /* No definition.  */
++  template <class T> bool operator!= (T) const; /* No definition.  */
++};
++
++/* This class tests that operator== is not used by assert.  */
++struct bool_and_int
++{
++  bool_and_int () = default;
++  bool_and_int (const no_int &) = delete;
++
++  explicit operator bool () const
++  {
++    return true;
++  }
++
++  bool operator! () const; /* No definition.  */
++  template <class T> bool operator== (T) const; /* No definition.  */
++  template <class T> bool operator!= (T) const; /* No definition.  */
++};
++
++static int
++do_test ()
++{
++  {
++    no_int value;
++    assert (value);
++  }
++
++  {
++    bool_and_int value;
++    assert (value);
++  }
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/assert/tst-assert-g++.cc b/assert/tst-assert-g++.cc
+new file mode 100644
+index 0000000000..8c06402825
+--- /dev/null
++++ b/assert/tst-assert-g++.cc
+@@ -0,0 +1,19 @@
++/* Tests for interactions between C++ and assert.  GNU C++11 version.
++   Copyright (C) 2017 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <http://www.gnu.org/licenses/>.  */
++
++#include <tst-assert-c++.cc>
 diff --git a/elf/Makefile b/elf/Makefile
 index 61abeb59ee..cc4aeb25b6 100644
 --- a/elf/Makefile

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


Reply to: