All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] package/dnsmasq: fix build with gcc 4.8
@ 2022-01-04 17:49 Arnout Vandecappelle
  2022-01-05 12:01 ` David Laight
  0 siblings, 1 reply; 3+ messages in thread
From: Arnout Vandecappelle @ 2022-01-04 17:49 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=17aa836bd7a2c90da053398ce024b4113cf8b53c
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Fix the following build failure with gcc 4.8 raised since bump to
version 2.86 in commit 5b29096f8fcb0acd8890073a56ba9d620b1f911c:

option.c: In function 'one_opt':
option.c:2445:11: error: 'for' loop initial declarations are only allowed in C99 mode
           for (char *p = arg; *p; p++) {
           ^
option.c:2445:11: note: use option -std=c99 or -std=gnu99 to compile your code
option.c:2453:11: error: 'for' loop initial declarations are only allowed in C99 mode
           for (u8 i = 0; i < sizeof(daemon->umbrella_device); i++, arg+=2) {
           ^

Fixes:
 - http://autobuild.buildroot.org/results/39b34a4e69fc10f4bd9d4ddb0ed8c0aae5741c84

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 .../0001-src-option.c-fix-build-with-gcc-4.8.patch | 52 ++++++++++++++++++++++
 ...2909d9080ff8743133fbd52427b4b2213171-typo.patch | 36 +++++++++++++++
 2 files changed, 88 insertions(+)

diff --git a/package/dnsmasq/0001-src-option.c-fix-build-with-gcc-4.8.patch b/package/dnsmasq/0001-src-option.c-fix-build-with-gcc-4.8.patch
new file mode 100644
index 0000000000..50ecf2f18a
--- /dev/null
+++ b/package/dnsmasq/0001-src-option.c-fix-build-with-gcc-4.8.patch
@@ -0,0 +1,52 @@
+From 46312909d9080ff8743133fbd52427b4b2213171 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 31 Dec 2021 17:29:44 +0100
+Subject: [PATCH] src/option.c: fix build with gcc 4.8
+
+Fix the following build failure with gcc 4.8 raised since version 2.86:
+
+option.c: In function 'one_opt':
+option.c:2445:11: error: 'for' loop initial declarations are only allowed in C99 mode
+           for (char *p = arg; *p; p++) {
+           ^
+option.c:2445:11: note: use option -std=c99 or -std=gnu99 to compile your code
+option.c:2453:11: error: 'for' loop initial declarations are only allowed in C99 mode
+           for (u8 i = 0; i < sizeof(daemon->umbrella_device); i++, arg+=2) {
+           ^
+
+Fixes:
+ - http://autobuild.buildroot.org/results/39b34a4e69fc10f4bd9d4ddb0ed8c0aae5741c84
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream commit 46312909d9080ff8743133fbd52427b4b2213171]
+---
+ src/option.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/option.c b/src/option.c
+index ff54def..c57f6d8 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -2525,7 +2525,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+           arg += 9;
+           if (strlen(arg) != 16)
+               ret_err(gen_err);
+-          for (char *p = arg; *p; p++) {
++          char *p;
++          for (*p = arg; *p; p++) {
+             if (!isxdigit((int)*p))
+               ret_err(gen_err);
+           }
+@@ -2533,7 +2534,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ 
+           u8 *u = daemon->umbrella_device;
+           char word[3];
+-          for (u8 i = 0; i < sizeof(daemon->umbrella_device); i++, arg+=2) {
++          u8 i;
++          for (i = 0; i < sizeof(daemon->umbrella_device); i++, arg+=2) {
+             memcpy(word, &(arg[0]), 2);
+             *u++ = strtoul(word, NULL, 16);
+           }
+-- 
+2.33.0
+
diff --git a/package/dnsmasq/0002-Fix-46312909d9080ff8743133fbd52427b4b2213171-typo.patch b/package/dnsmasq/0002-Fix-46312909d9080ff8743133fbd52427b4b2213171-typo.patch
new file mode 100644
index 0000000000..8cdf5b3f1b
--- /dev/null
+++ b/package/dnsmasq/0002-Fix-46312909d9080ff8743133fbd52427b4b2213171-typo.patch
@@ -0,0 +1,36 @@
+From 2748fb81e23b71e2c44956e99321816aca91905d Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sat, 1 Jan 2022 23:03:26 +0000
+Subject: [PATCH] Fix 46312909d9080ff8743133fbd52427b4b2213171 typo.
+
+[Upstream commit 2748fb81e23b71e2c44956e99321816aca91905d]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 
+---
+ src/option.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/option.c b/src/option.c
+index c57f6d8..6f56ce8 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -357,7 +357,7 @@ static const struct myoption opts[] =
+     { "dhcp-ignore-clid", 0, 0,  LOPT_IGNORE_CLID },
+     { "dynamic-host", 1, 0, LOPT_DYNHOST },
+     { "log-debug", 0, 0, LOPT_LOG_DEBUG },
+-	{ "umbrella", 2, 0, LOPT_UMBRELLA },
++    { "umbrella", 2, 0, LOPT_UMBRELLA },
+     { "quiet-tftp", 0, 0, LOPT_QUIET_TFTP },
+     { NULL, 0, 0, 0 }
+   };
+@@ -2526,7 +2526,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+           if (strlen(arg) != 16)
+               ret_err(gen_err);
+           char *p;
+-          for (*p = arg; *p; p++) {
++          for (p = arg; *p; p++) {
+             if (!isxdigit((int)*p))
+               ret_err(gen_err);
+           }
+-- 
+2.33.0
+
_______________________________________________
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] [git commit] package/dnsmasq: fix build with gcc 4.8
  2022-01-04 17:49 [Buildroot] [git commit] package/dnsmasq: fix build with gcc 4.8 Arnout Vandecappelle
@ 2022-01-05 12:01 ` David Laight
  0 siblings, 0 replies; 3+ messages in thread
From: David Laight @ 2022-01-05 12:01 UTC (permalink / raw)
  To: 'Arnout Vandecappelle', buildroot

From: Arnout Vandecappelle
> Sent: 04 January 2022 17:49
> 
> commit: https://git.buildroot.net/buildroot/commit/?id=17aa836bd7a2c90da053398ce024b4113cf8b53c
> branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
> 
> Fix the following build failure with gcc 4.8 raised since bump to
> version 2.86 in commit 5b29096f8fcb0acd8890073a56ba9d620b1f911c:
> 
> option.c: In function 'one_opt':
> option.c:2445:11: error: 'for' loop initial declarations are only allowed in C99 mode
>            for (char *p = arg; *p; p++) {
>            ^
> option.c:2445:11: note: use option -std=c99 or -std=gnu99 to compile your code
> option.c:2453:11: error: 'for' loop initial declarations are only allowed in C99 mode
>            for (u8 i = 0; i < sizeof(daemon->umbrella_device); i++, arg+=2) {
>            ^
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/39b34a4e69fc10f4bd9d4ddb0ed8c0aae5741c84
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
>  .../0001-src-option.c-fix-build-with-gcc-4.8.patch | 52 ++++++++++++++++++++++
>  ...2909d9080ff8743133fbd52427b4b2213171-typo.patch | 36 +++++++++++++++
>  2 files changed, 88 insertions(+)
> 
> diff --git a/package/dnsmasq/0001-src-option.c-fix-build-with-gcc-4.8.patch b/package/dnsmasq/0001-
> src-option.c-fix-build-with-gcc-4.8.patch
> new file mode 100644
> index 0000000000..50ecf2f18a
> --- /dev/null
> +++ b/package/dnsmasq/0001-src-option.c-fix-build-with-gcc-4.8.patch
> @@ -0,0 +1,52 @@
> +From 46312909d9080ff8743133fbd52427b4b2213171 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Fri, 31 Dec 2021 17:29:44 +0100
> +Subject: [PATCH] src/option.c: fix build with gcc 4.8
> +
> +Fix the following build failure with gcc 4.8 raised since version 2.86:
> +
> +option.c: In function 'one_opt':
> +option.c:2445:11: error: 'for' loop initial declarations are only allowed in C99 mode
> +           for (char *p = arg; *p; p++) {
> +           ^
> +option.c:2445:11: note: use option -std=c99 or -std=gnu99 to compile your code
> +option.c:2453:11: error: 'for' loop initial declarations are only allowed in C99 mode
> +           for (u8 i = 0; i < sizeof(daemon->umbrella_device); i++, arg+=2) {
> +           ^
> +
> +Fixes:
> + - http://autobuild.buildroot.org/results/39b34a4e69fc10f4bd9d4ddb0ed8c0aae5741c84
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +[Upstream commit 46312909d9080ff8743133fbd52427b4b2213171]
> +---
> + src/option.c | 6 ++++--
> + 1 file changed, 4 insertions(+), 2 deletions(-)
> +
> +diff --git a/src/option.c b/src/option.c
> +index ff54def..c57f6d8 100644
> +--- a/src/option.c
> ++++ b/src/option.c
> +@@ -2525,7 +2525,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int
> comma
> +           arg += 9;
> +           if (strlen(arg) != 16)
> +               ret_err(gen_err);
> +-          for (char *p = arg; *p; p++) {
> ++          char *p;
> ++          for (*p = arg; *p; p++) {

Isn't that going to get an error for mixing code and declarations?

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

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

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

* [Buildroot] [git commit] package/dnsmasq: fix build with gcc 4.8
@ 2022-03-03 21:26 Peter Korsgaard
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-03-03 21:26 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=610f52f3bea153a3293e67b95f7c4f31e74d2ffd
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Fix the following build failure with gcc 4.8 raised since bump to
version 2.86 in commit 5b29096f8fcb0acd8890073a56ba9d620b1f911c:

pattern.c: In function 'is_valid_dns_name':
pattern.c:134:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (const char *c = value;; c++)
   ^
pattern.c:134:3: note: use option -std=c99 or -std=gnu99 to compile your code
pattern.c: In function 'is_valid_dns_name_pattern':
pattern.c:249:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (const char *c = value;; c++)
   ^

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

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 ...0004-src-pattern.c-fix-build-with-gcc-4.8.patch | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/package/dnsmasq/0004-src-pattern.c-fix-build-with-gcc-4.8.patch b/package/dnsmasq/0004-src-pattern.c-fix-build-with-gcc-4.8.patch
new file mode 100644
index 0000000000..90bb02b23a
--- /dev/null
+++ b/package/dnsmasq/0004-src-pattern.c-fix-build-with-gcc-4.8.patch
@@ -0,0 +1,57 @@
+From 0c89dd2fa0fe50b00bca638dbbacfbd361526e0a Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sun, 2 Jan 2022 21:57:52 +0100
+Subject: [PATCH] src/pattern.c: fix build with gcc 4.8
+
+Fix the following build failure:
+
+pattern.c: In function 'is_valid_dns_name':
+pattern.c:134:3: error: 'for' loop initial declarations are only allowed in C99 mode
+   for (const char *c = value;; c++)
+   ^
+pattern.c:134:3: note: use option -std=c99 or -std=gnu99 to compile your code
+pattern.c: In function 'is_valid_dns_name_pattern':
+pattern.c:249:3: error: 'for' loop initial declarations are only allowed in C99 mode
+   for (const char *c = value;; c++)
+   ^
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Retrieved from:
+https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=b2690415bfa1bc105e61b75f642fb5c1aaf0fae8]
+---
+ src/pattern.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/pattern.c b/src/pattern.c
+index 03e23b9..928d259 100644
+--- a/src/pattern.c
++++ b/src/pattern.c
+@@ -129,9 +129,9 @@ int is_valid_dns_name(const char *value)
+   
+   size_t num_bytes = 0;
+   size_t num_labels = 0;
+-  const char *label = NULL;
++  const char *c, *label = NULL;
+   int is_label_numeric = 1;
+-  for (const char *c = value;; c++)
++  for (c = value;; c++)
+     {
+       if (*c &&
+ 	  *c != '-' && *c != '.' &&
+@@ -242,11 +242,11 @@ int is_valid_dns_name_pattern(const char *value)
+   
+   size_t num_bytes = 0;
+   size_t num_labels = 0;
+-  const char *label = NULL;
++  const char *c, *label = NULL;
+   int is_label_numeric = 1;
+   size_t num_wildcards = 0;
+   int previous_label_has_wildcard = 1;
+-  for (const char *c = value;; c++)
++  for (c = value;; c++)
+     {
+       if (*c &&
+ 	  *c != '*' && /* Wildcard. */
+-- 
+2.20.1
+
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-03-03 21:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 17:49 [Buildroot] [git commit] package/dnsmasq: fix build with gcc 4.8 Arnout Vandecappelle
2022-01-05 12:01 ` David Laight
2022-03-03 21:26 Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.