Skip to contentSkip to conversation

zbar: needs c99 mode

PATCH New Peter Seiderer 2 participants 2 messages Feb 27, 2019 – Feb 28, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 zbar: needs c99 mode

Fixes [1]:

bar/sqcode.c: In function 'sq_scan_shape':
zbar/sqcode.c:171:5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode

       for (int x = x0 - 1; x < x0 + width + 1; x++) {
       ^

zbar/sqcode.c:171:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

[1] http://autobuild.buildroot.net/results/7d544275756f655f9d42c05562aca653923155b1

---
 package/zbar/zbar.mk | 2 ++
 1 file changed, 2 insertions(+)
package/zbar/zbar.mk +2 -0
index 6df069e001..c3f0797c55 100644
@@ -13,6 +13,8 @@ ZBAR_AUTORECONF = YES
 ZBAR_DEPENDENCIES = libv4l jpeg
 # add host-gettext for AM_ICONV macro
 ZBAR_DEPENDENCIES += host-gettext
+# uses C99 features
+ZBAR_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
 ZBAR_CONF_OPTS = \
 	--disable-doc \
 	--without-imagemagick \
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 zbar: needs c99 mode

Quoted 6 lines · On Wed, 27 Feb 2019 23:01:00 +0100 Peter Seiderer <[email protected]> wrote:

Fixes [1]:

bar/sqcode.c: In function 'sq_scan_shape':
zbar/sqcode.c:171:5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode

       for (int x = x0 - 1; x < x0 + width + 1; x++) {
       ^
Quoted 8 lines

zbar/sqcode.c:171:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

[1] http://autobuild.buildroot.net/results/7d544275756f655f9d42c05562aca653923155b1

---
 package/zbar/zbar.mk | 2 ++
 1 file changed, 2 insertions(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com