* [Buildroot] [PATCH 1/1] package/open62541: fix build with nios2
@ 2021-07-27 7:37 Fabrice Fontaine
2021-07-28 19:19 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2021-07-27 7:37 UTC (permalink / raw)
To: buildroot; +Cc: Fabrice Fontaine
Fix the following build failure with nios2 raised since bump to version
1.2.2 in commit b436b82411305839abc76bb438fe92661a067526:
/home/buildroot/autobuild/instance-1/output-1/build/open62541-v1.2.2/src/ua_types_encoding_binary.c: In function 'unpack754':
/home/buildroot/autobuild/instance-1/output-1/build/open62541-v1.2.2/src/ua_types_encoding_binary.c:322:12: error: conversion to 'long double' from 'long long int' may alter its value [-Werror=conversion]
result /= (1LL<<significandbits);
^~
Fixes:
- http://autobuild.buildroot.org/results/c0a33dbada549c480bc741c1c8177b788ff053db
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
...licit-cast-to-avoid-compiler-warning.patch | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 package/open62541/0003-fix-core-Explicit-cast-to-avoid-compiler-warning.patch
diff --git a/package/open62541/0003-fix-core-Explicit-cast-to-avoid-compiler-warning.patch b/package/open62541/0003-fix-core-Explicit-cast-to-avoid-compiler-warning.patch
new file mode 100644
index 0000000000..dea325c17f
--- /dev/null
+++ b/package/open62541/0003-fix-core-Explicit-cast-to-avoid-compiler-warning.patch
@@ -0,0 +1,25 @@
+From 0c53fd776af9631c915c8722e1d68ce9a69fa3f6 Mon Sep 17 00:00:00 2001
+From: Andreas Walter <andreas.walter@waltronix.de>
+Date: Fri, 26 Feb 2021 11:49:25 +0100
+Subject: [PATCH] fix(core): Explicit cast to avoid compiler warning (#4203)
+
+[Retrieved from:
+https://github.com/open62541/open62541/commit/0c53fd776af9631c915c8722e1d68ce9a69fa3f6]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ src/ua_types_encoding_binary.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ua_types_encoding_binary.c b/src/ua_types_encoding_binary.c
+index 0fe88eb98e0..abbd23735d3 100644
+--- a/src/ua_types_encoding_binary.c
++++ b/src/ua_types_encoding_binary.c
+@@ -319,7 +319,7 @@ static long double
+ unpack754(uint64_t i, unsigned bits, unsigned expbits) {
+ unsigned significandbits = bits - expbits - 1;
+ long double result = (long double)(i&(uint64_t)((1LL<<significandbits)-1));
+- result /= (1LL<<significandbits);
++ result /= (long double)(1LL<<significandbits);
+ result += 1.0f;
+ unsigned bias = (unsigned)(1<<(expbits-1)) - 1;
+ long long shift = (long long)((i>>significandbits) & (uint64_t)((1LL<<expbits)-1)) - bias;
--
2.30.2
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/open62541: fix build with nios2
2021-07-27 7:37 [Buildroot] [PATCH 1/1] package/open62541: fix build with nios2 Fabrice Fontaine
@ 2021-07-28 19:19 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2021-07-28 19:19 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: buildroot
On Tue, 27 Jul 2021 09:37:55 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> Fix the following build failure with nios2 raised since bump to version
> 1.2.2 in commit b436b82411305839abc76bb438fe92661a067526:
>
> /home/buildroot/autobuild/instance-1/output-1/build/open62541-v1.2.2/src/ua_types_encoding_binary.c: In function 'unpack754':
> /home/buildroot/autobuild/instance-1/output-1/build/open62541-v1.2.2/src/ua_types_encoding_binary.c:322:12: error: conversion to 'long double' from 'long long int' may alter its value [-Werror=conversion]
> result /= (1LL<<significandbits);
> ^~
>
> Fixes:
> - http://autobuild.buildroot.org/results/c0a33dbada549c480bc741c1c8177b788ff053db
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> ...licit-cast-to-avoid-compiler-warning.patch | 25 +++++++++++++++++++
> 1 file changed, 25 insertions(+)
> create mode 100644 package/open62541/0003-fix-core-Explicit-cast-to-avoid-compiler-warning.patch
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-28 19:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-27 7:37 [Buildroot] [PATCH 1/1] package/open62541: fix build with nios2 Fabrice Fontaine
2021-07-28 19:19 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox