Skip to contentSkip to conversation

package/xenomai: fix build with gcc 11

PATCH Applied Dario Binacchi 3 participants 3 messages Sep 9, 2024 – Sep 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/xenomai: fix build with gcc 11

The commit adds an upstream patch to fix the following build failure:

latency.c: In function 'dump_histo_gnuplot':
latency.c:415:9: error: 'fclose' called on pointer returned from a mismatched allocation function [-Werror=mismatched-dealloc]

  415 |         fclose(ifp);
      |         ^~~~~~~~~~~
latency.c:404:15: note: returned from 'popen'
  404 |         ifp = popen(xconf, "r");
      |               ^~~~~~~~~~~~~~~~~

Fixes:
- http://autobuild.buildroot.org/results/e15ccef2f2bd58482204b5061f77e76a8a540ebd

---
 ...y-Use-corresponding-pclose-for-popen.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 package/xenomai/3.0.10/0005-testsuite-latency-Use-corresponding-pclose-for-popen.patch
package/xenomai/3.0.10/0005-testsuite-latency-Use-corresponding-pclose-for-popen.patch new file +30 -0
new file mode 100644
index 000000000000..a144c4ece35b
@@ -0,0 +1,30 @@
+From 6fe6b75bef4b4bb9723b12f0e9ebfd9877e00a44 Mon Sep 17 00:00:00 2001
+From: Jan Kiszka <[email protected]>
+Date: Sat, 16 Oct 2021 19:52:28 +0200
+Subject: [PATCH] testsuite/latency: Use corresponding pclose for popen
+
+Was found by latest gcc-11 and -Werror=mismatched-dealloc.
+
+Signed-off-by: Jan Kiszka <[email protected]>
+Signed-off-by: Dario Binacchi <[email protected]>
+Upstream: https://source.denx.de/Xenomai/xenomai/-/commit/6fe6b75bef4b4bb9723b12f0e9ebfd9877e00a44
+---
+ testsuite/latency/latency.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testsuite/latency/latency.c b/testsuite/latency/latency.c
+index a0e6f4826084..6cd3a28b44f6 100644
+--- a/testsuite/latency/latency.c
++++ b/testsuite/latency/latency.c
+@@ -412,7 +412,7 @@ static void dump_histo_gnuplot(int32_t *histogram, time_t duration)
+ 		fputs(buf, ofp);
+ 	}
+ 
+-	fclose(ifp);
++	pclose(ifp);
+ 
+ dump_data:
+ 	for (n = 0; n < histogram_size && histogram[n] == 0; n++)
+-- 
+2.43.0
+
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 10 lines · On Mon, 9 Sep 2024 08:33:39 +0200 Dario Binacchi…

The commit adds an upstream patch to fix the following build failure:

latency.c: In function 'dump_histo_gnuplot':
latency.c:415:9: error: 'fclose' called on pointer returned from a mismatched allocation function [-Werror=mismatched-dealloc]

  415 |         fclose(ifp);
      |         ^~~~~~~~~~~
latency.c:404:15: note: returned from 'popen'
  404 |         ifp = popen(xconf, "r");
      |               ^~~~~~~~~~~~~~~~~
Quoted 8 lines

Fixes:
- http://autobuild.buildroot.org/results/e15ccef2f2bd58482204b5061f77e76a8a540ebd

---
 ...y-Use-corresponding-pclose-for-popen.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 package/xenomai/3.0.10/0005-testsuite-latency-Use-corresponding-pclose-for-popen.patch

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 19 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:

Quoted 14 lines · On Mon, 9 Sep 2024 08:33:39 +0200 Dario Binacchi…

The commit adds an upstream patch to fix the following build failure:

latency.c: In function 'dump_histo_gnuplot':
latency.c:415:9: error: 'fclose' called on pointer returned from a mismatched allocation function [-Werror=mismatched-dealloc]
415 | fclose(ifp);
| ^~~~~~~~~~~
latency.c:404:15: note: returned from 'popen'
404 | ifp = popen(xconf, "r");
| ^~~~~~~~~~~~~~~~~

Fixes:
- http://autobuild.buildroot.org/results/e15ccef2f2bd58482204b5061f77e76a8a540ebd

Quoted 8 lines
Quoted 6 lines

---
...y-Use-corresponding-pclose-for-popen.patch | 30 +++++++++++++++++++

1 file changed, 30 insertions(+)

create mode 100644 package/xenomai/3.0.10/0005-testsuite-latency-Use-corresponding-pclose-for-popen.patch

Applied to master, thanks.

Committed to 2024.02.x and 2024.08.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot