diff options
author | Rosen Penev <rosenp@gmail.com> | 2019-10-07 15:59:52 -0700 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2019-10-12 23:43:08 +0200 |
commit | 6ab386c9bc23420816fbcefc84b62cf5438b2c66 (patch) | |
tree | fa009cdf75a4dc6a0165d5d950f2948a2db5604e /package/libs/uclibc++/patches/005-istream_helpers-Fix-sscanf-typo.patch | |
parent | c5829788c955efc9c52f8a740987e362cacd95d8 (diff) | |
download | upstream-6ab386c9bc23420816fbcefc84b62cf5438b2c66.tar.gz upstream-6ab386c9bc23420816fbcefc84b62cf5438b2c66.tar.bz2 upstream-6ab386c9bc23420816fbcefc84b62cf5438b2c66.zip |
uClibc++: Fix three bugs
The first allows usage of several functions in the std namespace, which
broke compilation of gddrescue specifically with uClibc-ng and uClibc++.
The second allows usage of long long with normal C++11, which is part of
the standard. Before, std=gnu++11 needed to be passsed to work around it.
As a result of the second patch, the pedantic patch can safely be removed.
Both patches are upstream backports.
Added -std=c++11 to CFLAGS to guarentee proper inclusion of long long.
Added another patch that fixes a typo with the long long support. Sent to
upstream.
Fixed up license information according to SPDX.
Small cleanups for consistency.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'package/libs/uclibc++/patches/005-istream_helpers-Fix-sscanf-typo.patch')
-rw-r--r-- | package/libs/uclibc++/patches/005-istream_helpers-Fix-sscanf-typo.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/package/libs/uclibc++/patches/005-istream_helpers-Fix-sscanf-typo.patch b/package/libs/uclibc++/patches/005-istream_helpers-Fix-sscanf-typo.patch new file mode 100644 index 0000000000..66b62c197c --- /dev/null +++ b/package/libs/uclibc++/patches/005-istream_helpers-Fix-sscanf-typo.patch @@ -0,0 +1,37 @@ +From 7f6dd860818512c0eb313320308b22ba7e2c7205 Mon Sep 17 00:00:00 2001 +From: Rosen Penev <rosenp@gmail.com> +Date: Fri, 4 Oct 2019 20:06:53 -0700 +Subject: [PATCH] istream_helpers: Fix sscanf typo + +This caused readin not to work properly with long long types. + +Found accidentally through a glibc warning +(declared with warn_unused_result). + +Tested with gptfdisk on OpenWrt. + +Signed-off-by: Rosen Penev <rosenp@gmail.com> +--- + include/istream_helpers | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/include/istream_helpers ++++ b/include/istream_helpers +@@ -317,7 +317,7 @@ namespace std{ + sscanf(temp.c_str(), "%llo", (unsigned long long *)&var ); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ +- scanf(temp.c_str(), "%llX", (unsigned long long *)&var ); ++ sscanf(temp.c_str(), "%llX", (unsigned long long *)&var ); + }else{ + sscanf(temp.c_str(), "%llx", (unsigned long long *)&var); + } +@@ -344,7 +344,7 @@ namespace std{ + sscanf(temp.c_str(), "%llo", &var ); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ +- scanf(temp.c_str(), "%llX", &var ); ++ sscanf(temp.c_str(), "%llX", &var ); + }else{ + sscanf(temp.c_str(), "%llx", &var); + } |