Skip to contentSkip to conversation

package/libargtable2: fix build error

PATCH Applied Thomas Perale via buildroot 1 participant 3 messages Jul 10, 2025 – Jul 17, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libargtable2: fix build error

The following build error is happening on the autobuilder:

```
arg_int.c:60:12: error: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]
   60 |     while (isspace(*ptr))
      |            ^~~~~~~
arg_int.c:33:1: note: include '<ctype.h>' or provide a declaration of 'isspace'
   32 | #include <limits.h>
  +++ |+#include <ctype.h>
   33 |
arg_int.c:89:8: error: implicit declaration of function 'toupper' [-Wimplicit-function-declaration]
   89 |    if (toupper(*ptr++)!=toupper(X))
      |        ^~~~~~~
arg_int.c:89:8: note: include '<ctype.h>' or provide a declaration of 'toupper'
```

Both isspace and toupper are declared in the ctype.h header. The include was added in a later upstream commit.
This patch adds that upstream commit and strip everything else to only patch that include.

---
 .../libargtable2/0001-apply-uint-patch.patch  | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 package/libargtable2/0001-apply-uint-patch.patch
package/libargtable2/0001-apply-uint-patch.patch new file +25 -0
new file mode 100644
index 0000000000..fed0307852
@@ -0,0 +1,25 @@
+From 3fe1ce4d7aa7c4fc16471a9ab023ecf6628c2f11 Mon Sep 17 00:00:00 2001
+From: Chris McClelland <[email protected]>
+Date: Thu, 12 Nov 2020 14:18:27 +0000
+Subject: [PATCH] Apply uint patch
+
+Upstream: https://github.com/makestuff/libargtable2/commit/3fe1ce4d7aa7c4fc16471a9ab023ecf6628c2f11
+[thomas: strip to only have the include]
+Signed-off-by: Thomas Perale <[email protected]>
+---
+ src/arg_int.c     |  2 ++
+ 1 files changed, 2 insertions(+)
+
+diff --git a/src/arg_int.c b/src/arg_int.c
+index 29c20e5..c51706a 100644
+--- a/src/arg_int.c
++++ b/src/arg_int.c
+@@ -24,6 +24,8 @@ USA.
+ #include "config.h"
+ #endif
+ 
++#include <ctype.h>
++
+ /* #ifdef HAVE_STDLIB_H */
+ #include <stdlib.h>
+ /* #endif */
Signature · 6 lines
2.50.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 16 lines · Thomas Perale via buildroot

The following build error is happening on the autobuilder:

```
arg_int.c:60:12: error: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]
   60 |     while (isspace(*ptr))
      |            ^~~~~~~
arg_int.c:33:1: note: include '<ctype.h>' or provide a declaration of 'isspace'
   32 | #include <limits.h>
  +++ |+#include <ctype.h>
   33 |
arg_int.c:89:8: error: implicit declaration of function 'toupper' [-Wimplicit-function-declaration]
   89 |    if (toupper(*ptr++)!=toupper(X))
      |        ^~~~~~~
arg_int.c:89:8: note: include '<ctype.h>' or provide a declaration of 'toupper'
```
Quoted 7 lines

Both isspace and toupper are declared in the ctype.h header. The include was added in a later upstream commit.
This patch adds that upstream commit and strip everything else to only patch that include.

Applied to master, thanks.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
In reply to Thomas Perale via buildroot
Quoted 16 lines · Thomas Perale via buildroot

The following build error is happening on the autobuilder:

```
arg_int.c:60:12: error: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]
    60 |     while (isspace(*ptr))
       |            ^~~~~~~
arg_int.c:33:1: note: include '<ctype.h>' or provide a declaration of 'isspace'
    32 | #include <limits.h>
   +++ |+#include <ctype.h>
    33 |
arg_int.c:89:8: error: implicit declaration of function 'toupper' [-Wimplicit-function-declaration]
    89 |    if (toupper(*ptr++)!=toupper(X))
       |        ^~~~~~~
arg_int.c:89:8: note: include '<ctype.h>' or provide a declaration of 'toupper'
```
Quoted 7 lines

Both isspace and toupper are declared in the ctype.h header. The include was added in a later upstream commit.
This patch adds that upstream commit and strip everything else to only patch that include.

Applied to 2025.02.x and 2025.05.x, thanks.

Regards,
Arnout

Quoted 26 lines
---
  .../libargtable2/0001-apply-uint-patch.patch  | 25 +++++++++++++++++++
  1 file changed, 25 insertions(+)

create mode 100644 package/libargtable2/0001-apply-uint-patch.patch

package/libargtable2/0001-apply-uint-patch.patch new file +15 -0
new file mode 100644
index 0000000000..fed0307852
@@ -0,0 +1,25 @@
+From 3fe1ce4d7aa7c4fc16471a9ab023ecf6628c2f11 Mon Sep 17 00:00:00 2001
+From: Chris McClelland <[email protected]>
+Date: Thu, 12 Nov 2020 14:18:27 +0000
+Subject: [PATCH] Apply uint patch
+
+Upstream: https://github.com/makestuff/libargtable2/commit/3fe1ce4d7aa7c4fc16471a9ab023ecf6628c2f11
+[thomas: strip to only have the include]
+Signed-off-by: Thomas Perale <[email protected]>
+---
+ src/arg_int.c     |  2 ++
+ 1 files changed, 2 insertions(+)
+
+diff --git a/src/arg_int.c b/src/arg_int.c
+index 29c20e5..c51706a 100644
+--- a/src/arg_int.c

package/libargtable2/0001-apply-uint-patch.patch line 25

Quoted 10 lines
package/libargtable2/0001-apply-uint-patch.patch new file +10 -0
++++ b/src/arg_int.c
+@@ -24,6 +24,8 @@ USA.
+ #include "config.h"
+ #endif
+
++#include <ctype.h>
++
+ /* #ifdef HAVE_STDLIB_H */
+ #include <stdlib.h>
+ /* #endif */

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot