Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/libp11: fix build with gcc 4.8
@ 2022-08-12 12:19 Fabrice Fontaine
  2022-08-14 10:17 ` Thomas Petazzoni via buildroot
  2022-09-15  8:38 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2022-08-12 12:19 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

Fix the following build failure with gcc 4.8 raised since bump to
version 0.4.12 in commit 86ab91483dcb4b60de8c1daa20e2f42bd95ab5fb and
https://github.com/OpenSC/libp11/commit/639a4b6463278c0119a2ec60b261da3e5330fb33:

p11_attr.c: In function 'pkcs11_zap_attrs':
p11_attr.c:167:2: error: 'for' loop initial declarations are only allowed in C99 mode
  for (unsigned i = 0; i < 32; i++) {
  ^
p11_attr.c:167:2: note: use option -std=c99 or -std=gnu99 to compile your code

Fixes:
 - http://autobuild.buildroot.org/results/4391020fb5738cc8c26dc53783a6228bbf76473a

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...rc-p11_attr.c-fix-build-with-gcc-4.8.patch | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 package/libp11/0001-src-p11_attr.c-fix-build-with-gcc-4.8.patch

diff --git a/package/libp11/0001-src-p11_attr.c-fix-build-with-gcc-4.8.patch b/package/libp11/0001-src-p11_attr.c-fix-build-with-gcc-4.8.patch
new file mode 100644
index 0000000000..60fc16d9d0
--- /dev/null
+++ b/package/libp11/0001-src-p11_attr.c-fix-build-with-gcc-4.8.patch
@@ -0,0 +1,42 @@
+From ba44b87318ed89e489fa3ce0a5d66002afa2bd6c Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 12 Aug 2022 11:54:54 +0200
+Subject: [PATCH] src/p11_attr.c: fix build with gcc 4.8
+
+Fix the following build failure with gcc 4.8 raised since version 0.4.12
+and
+https://github.com/OpenSC/libp11/commit/639a4b6463278c0119a2ec60b261da3e5330fb33:
+
+p11_attr.c: In function 'pkcs11_zap_attrs':
+p11_attr.c:167:2: error: 'for' loop initial declarations are only allowed in C99 mode
+  for (unsigned i = 0; i < 32; i++) {
+  ^
+p11_attr.c:167:2: note: use option -std=c99 or -std=gnu99 to compile your code
+
+Fixes:
+ - http://autobuild.buildroot.org/results/4391020fb5738cc8c26dc53783a6228bbf76473a
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Retrieved from:
+https://github.com/OpenSC/libp11/commit/ba44b87318ed89e489fa3ce0a5d66002afa2bd6c]
+---
+ src/p11_attr.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/p11_attr.c b/src/p11_attr.c
+index d49456ff..d425241a 100644
+--- a/src/p11_attr.c
++++ b/src/p11_attr.c
+@@ -162,9 +162,11 @@ void pkcs11_addattr_obj(PKCS11_TEMPLATE *tmpl, int type, pkcs11_i2d_fn enc, void
+ 
+ void pkcs11_zap_attrs(PKCS11_TEMPLATE *tmpl)
+ {
++	unsigned int i;
++
+ 	if (!tmpl->allocated)
+ 		return;
+-	for (unsigned i = 0; i < 32; i++) {
++	for (i = 0; i < 32; i++) {
+ 		if (tmpl->allocated & (1<<i))
+ 			OPENSSL_free(tmpl->attrs[i].pValue);
+ 	}
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/libp11: fix build with gcc 4.8
  2022-08-12 12:19 [Buildroot] [PATCH 1/1] package/libp11: fix build with gcc 4.8 Fabrice Fontaine
@ 2022-08-14 10:17 ` Thomas Petazzoni via buildroot
  2022-09-15  8:38 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-14 10:17 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

On Fri, 12 Aug 2022 14:19:13 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix the following build failure with gcc 4.8 raised since bump to
> version 0.4.12 in commit 86ab91483dcb4b60de8c1daa20e2f42bd95ab5fb and
> https://github.com/OpenSC/libp11/commit/639a4b6463278c0119a2ec60b261da3e5330fb33:
> 
> p11_attr.c: In function 'pkcs11_zap_attrs':
> p11_attr.c:167:2: error: 'for' loop initial declarations are only allowed in C99 mode
>   for (unsigned i = 0; i < 32; i++) {
>   ^
> p11_attr.c:167:2: note: use option -std=c99 or -std=gnu99 to compile your code
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/4391020fb5738cc8c26dc53783a6228bbf76473a
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...rc-p11_attr.c-fix-build-with-gcc-4.8.patch | 42 +++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100644 package/libp11/0001-src-p11_attr.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
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/libp11: fix build with gcc 4.8
  2022-08-12 12:19 [Buildroot] [PATCH 1/1] package/libp11: fix build with gcc 4.8 Fabrice Fontaine
  2022-08-14 10:17 ` Thomas Petazzoni via buildroot
@ 2022-09-15  8:38 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-09-15  8:38 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix the following build failure with gcc 4.8 raised since bump to
 > version 0.4.12 in commit 86ab91483dcb4b60de8c1daa20e2f42bd95ab5fb and
 > https://github.com/OpenSC/libp11/commit/639a4b6463278c0119a2ec60b261da3e5330fb33:

 > p11_attr.c: In function 'pkcs11_zap_attrs':
 > p11_attr.c:167:2: error: 'for' loop initial declarations are only allowed in C99 mode
 >   for (unsigned i = 0; i < 32; i++) {
 >   ^
 > p11_attr.c:167:2: note: use option -std=c99 or -std=gnu99 to compile your code

 > Fixes:
 >  - http://autobuild.buildroot.org/results/4391020fb5738cc8c26dc53783a6228bbf76473a

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2022.05.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-15  8:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-12 12:19 [Buildroot] [PATCH 1/1] package/libp11: fix build with gcc 4.8 Fabrice Fontaine
2022-08-14 10:17 ` Thomas Petazzoni via buildroot
2022-09-15  8:38 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox