* [PATCH] scripts: imx-usb-loader: list_imx_device_types(): move variable declaration out of for() loop
@ 2018-10-26 11:29 Marc Kleine-Budde
2018-10-26 11:33 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Marc Kleine-Budde @ 2018-10-26 11:29 UTC (permalink / raw)
To: barebox; +Cc: sha
On older compilers this causes the following error:
| scripts/imx/imx-usb-loader.c: In function 'list_imx_device_types':
| scripts/imx/imx-usb-loader.c:252:2: error: 'for' loop initial declarations are only allowed in C99 mode
| for (int i = 0; i < ARRAY_SIZE(imx_ids); i++) {
| ^
| scripts/imx/imx-usb-loader.c:252:2: note: use option -std=c99 or -std=gnu99 to compile your code
Fixes: bcc2df673cdb ("scripts: imx-usb-loader: allow use of unknown USB IDs")
Reported-by: Niklas Reisser <Niklas.Reisser@de.bosch.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
scripts/imx/imx-usb-loader.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
index 4336bc8d532d..d4fba0ce54e8 100644
--- a/scripts/imx/imx-usb-loader.c
+++ b/scripts/imx/imx-usb-loader.c
@@ -249,7 +249,9 @@ static const struct mach_id *imx_device_by_type(const char *name)
static void list_imx_device_types(void)
{
- for (int i = 0; i < ARRAY_SIZE(imx_ids); i++) {
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(imx_ids); i++) {
printf("%s\n", imx_ids[i].name);
}
}
--
2.19.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] scripts: imx-usb-loader: list_imx_device_types(): move variable declaration out of for() loop
2018-10-26 11:29 [PATCH] scripts: imx-usb-loader: list_imx_device_types(): move variable declaration out of for() loop Marc Kleine-Budde
@ 2018-10-26 11:33 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2018-10-26 11:33 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: barebox
On Fri, Oct 26, 2018 at 01:29:14PM +0200, Marc Kleine-Budde wrote:
> On older compilers this causes the following error:
> | scripts/imx/imx-usb-loader.c: In function 'list_imx_device_types':
> | scripts/imx/imx-usb-loader.c:252:2: error: 'for' loop initial declarations are only allowed in C99 mode
> | for (int i = 0; i < ARRAY_SIZE(imx_ids); i++) {
> | ^
> | scripts/imx/imx-usb-loader.c:252:2: note: use option -std=c99 or -std=gnu99 to compile your code
>
> Fixes: bcc2df673cdb ("scripts: imx-usb-loader: allow use of unknown USB IDs")
> Reported-by: Niklas Reisser <Niklas.Reisser@de.bosch.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
> scripts/imx/imx-usb-loader.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Applied, thanks
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-26 11:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26 11:29 [PATCH] scripts: imx-usb-loader: list_imx_device_types(): move variable declaration out of for() loop Marc Kleine-Budde
2018-10-26 11:33 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox