diff options
author | Paulo Matias | 2020-05-22 16:44:43 -0300 |
---|---|---|
committer | Paulo Matias | 2020-05-22 16:45:11 -0300 |
commit | d6f3d46a01583db4d59db6d0de20518cd9211b18 (patch) | |
tree | bcdc56878ec18cbf94108f39ca1daf3045d980a7 | |
parent | b8f2184ebebc2b2552eacd52506358984a269c47 (diff) | |
download | aur-d6f3d46a01583db4d59db6d0de20518cd9211b18.tar.gz |
patch B-Lang-org/bsc#172
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | 172.patch | 86 | ||||
-rw-r--r-- | PKGBUILD | 9 |
3 files changed, 95 insertions, 4 deletions
@@ -1,6 +1,6 @@ pkgbase = bluespec-git pkgdesc = Bluespec Compiler (BSC) - pkgver = r297.03e603c + pkgver = r301.9f4a447 pkgrel = 1 url = https://github.com/B-Lang-org/bsc arch = x86_64 @@ -15,7 +15,9 @@ pkgbase = bluespec-git depends = haskell-split optdepends = tcl: bluesim and bluetcl source = git+https://github.com/b-lang-org/bsc.git + source = 172.patch sha256sums = SKIP + sha256sums = 6348a39c84eb57920d05e44813bb233ea105e9f7a426255e45286f27ba7c3067 pkgname = bluespec-git diff --git a/172.patch b/172.patch new file mode 100644 index 000000000000..3ff676a02961 --- /dev/null +++ b/172.patch @@ -0,0 +1,86 @@ +From a40fe6b6144aaf6b2c0484cea02499938c4a3fcf Mon Sep 17 00:00:00 2001 +From: Paulo Matias <matias@ufscar.br> +Date: Tue, 19 May 2020 10:14:23 -0300 +Subject: [PATCH] Silence false positive overflow error on gcc 10 + +`0 <= numDigits(v, base) <= 64` for any `v`, `base`. However, since the +value is returned as an `unsigned int`, gcc 10 alerts for a possible +overflow on `char buf[value_width+1]`, although it is a false positive. +By returning an `unsigned short`, the warning (which is actually treated +as an error due to the CXXFLAGS) is silenced. +--- + src/bluesim/dollar_display.cxx | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/bluesim/dollar_display.cxx b/src/bluesim/dollar_display.cxx +index 61adaaa..9d385fb 100644 +--- a/src/bluesim/dollar_display.cxx ++++ b/src/bluesim/dollar_display.cxx +@@ -91,7 +91,7 @@ static unsigned int maxWidth(unsigned int nBits, bool isSigned, + + // Return the number of digits required to represent a given value + // in the specified base. +-static unsigned int numDigits(const tValue& v, unsigned int base=10) ++static unsigned short numDigits(const tValue& v, unsigned int base=10) + { + if (v.bits < 2) + return 1; +@@ -569,7 +569,7 @@ const char* print_decimal(tFieldDesc& spec, ArgList* args, Target* dest) + } + else if (v.bits == 1) + { +- unsigned int value_width = numDigits(v); ++ unsigned short value_width = numDigits(v); + pad(spec.width, field_width, value_width, ' ', dest); + if (v.isSigned && v.data.bitVal) + dest->write_char('-'); +@@ -577,7 +577,7 @@ const char* print_decimal(tFieldDesc& spec, ArgList* args, Target* dest) + } + else + { +- unsigned int value_width = numDigits(v); ++ unsigned short value_width = numDigits(v); + pad(spec.width, field_width, value_width, ' ', dest); + unsigned long long x; + if (v.isSigned) +@@ -632,13 +632,13 @@ const char* print_hex(tFieldDesc& spec, ArgList* args, Target* dest) + } + else if (v.bits == 1) + { +- unsigned int value_width = numDigits(v,16); ++ unsigned short value_width = numDigits(v,16); + pad(spec.width, field_width, value_width, '0', dest); + dest->write_char(v.data.bitVal ? '1' : '0'); + } + else + { +- unsigned int value_width = numDigits(v,16); ++ unsigned short value_width = numDigits(v,16); + pad(spec.width, field_width, value_width, '0', dest); + unsigned long long x = v.data.uVal; + if (v.bits < 64) +@@ -685,13 +685,13 @@ const char* print_octal(tFieldDesc& spec, ArgList* args, Target* dest) + } + else if (v.bits == 1) + { +- unsigned int value_width = numDigits(v,8); ++ unsigned short value_width = numDigits(v,8); + pad(spec.width, field_width, value_width, '0', dest); + dest->write_char(v.data.bitVal ? '1' : '0'); + } + else + { +- unsigned int value_width = numDigits(v,8); ++ unsigned short value_width = numDigits(v,8); + pad(spec.width, field_width, value_width, '0', dest); + unsigned long long x = v.data.uVal; + if (v.bits < 64) +@@ -735,7 +735,7 @@ const char* print_binary(tFieldDesc& spec, ArgList* args, Target* dest) + } + else + { +- unsigned int value_width = numDigits(v,2); ++ unsigned short value_width = numDigits(v,2); + pad(spec.width, field_width, value_width, '0', dest); + char buf[value_width+1]; + buf[value_width] = '\0'; @@ -2,7 +2,7 @@ # Maintainer: Paulo Matias <matias@ufscar.br> pkgname=bluespec-git -pkgver=r297.03e603c +pkgver=r301.9f4a447 pkgrel=1 pkgdesc='Bluespec Compiler (BSC)' arch=('x86_64') @@ -11,8 +11,10 @@ license=('BSD') depends=('haskell-old-time' 'haskell-syb' 'haskell-regex-compat' 'haskell-split') makedepends=('git' 'gperf' 'ghc' 'tcl') optdepends=('tcl: bluesim and bluetcl') -source=("git+https://github.com/b-lang-org/bsc.git") -sha256sums=('SKIP') +source=("git+https://github.com/b-lang-org/bsc.git" + "172.patch") +sha256sums=('SKIP' + '6348a39c84eb57920d05e44813bb233ea105e9f7a426255e45286f27ba7c3067') _prefix="/opt/bluespec" pkgver() { @@ -23,6 +25,7 @@ pkgver() { prepare() { cd "$srcdir/bsc" git submodule update --init --recursive + patch -Np1 -i ../172.patch } build(){ |