Graham, here is patch attached for the issue. By default some architectures have "char" being unsigned such as the ones listed here and others ( https://wiki.debian.org/ArchitectureSpecificsMemo ). I just forced the sign-ness of pow()'s argument. Sorry for the delay.
F. On Mon, 20 Nov 2017 21:10:24 +0200, Graham Inggs <[email protected]> wrote: > Hi Frederic > > > Just for the record, this bug also happens on arm64. > > This seems to be a regression. I'm trying to bisect that. > > Did you ever make any progress with this? > > Regards > Graham >
Index: freecad-0.16.6712+dfsg1/src/Base/Unit.cpp
===================================================================
--- freecad-0.16.6712+dfsg1.orig/src/Base/Unit.cpp 2017-07-17
17:27:47.000000000 +0000
+++ freecad-0.16.6712+dfsg1/src/Base/Unit.cpp 2017-12-07 16:14:39.330651565
+0000
@@ -113,7 +113,7 @@
}
-Unit Unit::pow(char exp)const
+Unit Unit::pow(signed char exp)const
{
checkRange("pow()",
(int32_t)Sig.Length * (int32_t)exp,
Index: freecad-0.16.6712+dfsg1/src/Base/Unit.h
===================================================================
--- freecad-0.16.6712+dfsg1.orig/src/Base/Unit.h 2017-07-17
17:27:47.000000000 +0000
+++ freecad-0.16.6712+dfsg1/src/Base/Unit.h 2017-12-07 16:15:07.739356583
+0000
@@ -79,7 +79,7 @@
bool operator ==(const Unit&) const;
bool operator !=(const Unit&that) const {return !(*this == that);}
Unit& operator =(const Unit&);
- Unit pow(char exp)const;
+ Unit pow(signed char exp)const;
//@}
/// get the unit signature
const UnitSignature & getSignature(void)const {return Sig;}
pgpYtpfPHlDZF.pgp
Description: PGP signature

