* [Buildroot] [PATCH 1/1] package/sispmctl: fix build with gcc 4.8
@ 2020-10-29 13:00 Fabrice Fontaine
2020-10-31 22:44 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2020-10-29 13:00 UTC (permalink / raw)
To: buildroot
Fixes:
- http://autobuild.buildroot.org/results/079f1454121d38a83c49529c0f6cc8ed61fd5abb
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
...rc-schedule.c-fix-build-with-gcc-4.8.patch | 56 +++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100644 package/sispmctl/0001-src-schedule.c-fix-build-with-gcc-4.8.patch
diff --git a/package/sispmctl/0001-src-schedule.c-fix-build-with-gcc-4.8.patch b/package/sispmctl/0001-src-schedule.c-fix-build-with-gcc-4.8.patch
new file mode 100644
index 0000000000..69dc31e353
--- /dev/null
+++ b/package/sispmctl/0001-src-schedule.c-fix-build-with-gcc-4.8.patch
@@ -0,0 +1,56 @@
+From 3ccbb67c71aa13b9a37a58363d37a18b8fdbf300 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Thu, 29 Oct 2020 13:36:00 +0100
+Subject: [PATCH] src/schedule.c: fix build with gcc 4.8
+
+Fix the following build failure with gcc 4.8:
+
+schedule.c:19:2: error: 'for' loop initial declarations are only allowed in C99 mode
+ for (int i = 0; i < 4; ++i) {
+ ^
+schedule.c:19:2: note: use option -std=c99 or -std=gnu99 to compile your code
+schedule.c: In function 'pms2_read_block':
+schedule.c:39:2: error: 'for' loop initial declarations are only allowed in C99 mode
+ for (int i = 0; i < 4; ++i) {
+ ^
+
+Fixes:
+ - http://autobuild.buildroot.org/results/079f1454121d38a83c49529c0f6cc8ed61fd5abb
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status:
+https://sourceforge.net/p/sispmctl/git/merge-requests/1]
+---
+ src/schedule.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/schedule.c b/src/schedule.c
+index 4dd908d..1725421 100644
+--- a/src/schedule.c
++++ b/src/schedule.c
+@@ -15,8 +15,9 @@
+ static unsigned char
+ *pms2_write_block(uint8_t action, uint32_t time, unsigned char *ptr)
+ {
++ int i;
+ *ptr++ = action;
+- for (int i = 0; i < 4; ++i) {
++ for (i = 0; i < 4; ++i) {
+ *ptr++ = (uint8_t)time;
+ time >>= 8;
+ }
+@@ -34,9 +35,10 @@ static unsigned char
+ static const unsigned char
+ *pms2_read_block(uint8_t *action, uint32_t *time, const unsigned char *ptr)
+ {
++ int i;
+ *action = *ptr++;
+ *time = 0;
+- for (int i = 0; i < 4; ++i) {
++ for (i = 0; i < 4; ++i) {
+ *time >>= 8;
+ *time += (uint32_t)*ptr++ << 24;
+ }
+--
+2.28.0
+
--
2.28.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH 1/1] package/sispmctl: fix build with gcc 4.8
2020-10-29 13:00 [Buildroot] [PATCH 1/1] package/sispmctl: fix build with gcc 4.8 Fabrice Fontaine
@ 2020-10-31 22:44 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2020-10-31 22:44 UTC (permalink / raw)
To: buildroot
On Thu, 29 Oct 2020 14:00:31 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> Fixes:
> - http://autobuild.buildroot.org/results/079f1454121d38a83c49529c0f6cc8ed61fd5abb
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> ...rc-schedule.c-fix-build-with-gcc-4.8.patch | 56 +++++++++++++++++++
> 1 file changed, 56 insertions(+)
> create mode 100644 package/sispmctl/0001-src-schedule.c-fix-build-with-gcc-4.8.patch
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-31 22:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-29 13:00 [Buildroot] [PATCH 1/1] package/sispmctl: fix build with gcc 4.8 Fabrice Fontaine
2020-10-31 22:44 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox