Skip to contentSkip to conversation

package/ngrep: fix implicit function declaration

PATCH Applied Thomas Bonnefille via buildroot 1 participant 6 messages Aug 2, 2025 – Aug 14, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/ngrep: fix implicit function declaration

---
This patch can be backported to 2025.02.x as this issue is reproducible on the current version of the LTS.

---
 ....h-and-tcpkill.h-to-avoid-implicit-functi.patch | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
package/ngrep/0006-Include-err.h-and-tcpkill.h-to-avoid-implicit-functi.patch new file +44 -0
new file mode 100644
index 0000000000000000000000000000000000000000..6d596bfe3791a33994179494e8c08ec7a9439975
@@ -0,0 +1,44 @@
+From 52515bae377f221b5473d9040f5f43ab1c672672 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <[email protected]>
+Date: Mon, 19 Dec 2022 11:49:06 +0100
+Subject: [PATCH] Include <err.h> and "tcpkill.h" to avoid implicit function
+ declarations
+
+Implicit function declarations are a historic language feature that
+were removed from C in 1999.
+
+Upstream: https://github.com/jpr5/ngrep/pull/28
+
+Signed-off-by: Thomas Bonnefille <[email protected]>
+---
+ ngrep.c   | 1 +
+ tcpkill.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/ngrep.c b/ngrep.c
+index 3df9389..b2fcceb 100644
+--- a/ngrep.c
++++ b/ngrep.c
+@@ -98,6 +98,7 @@
+ #endif
+ 
+ #include "ngrep.h"
++#include "tcpkill.h"
+ 
+ 
+ /*
+diff --git a/tcpkill.c b/tcpkill.c
+index 5388ec5..ac8fd2e 100644
+--- a/tcpkill.c
++++ b/tcpkill.c
+@@ -14,6 +14,7 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <string.h>
++#include <err.h>
+ #include <libnet.h>
+ #include <pcap.h>
+ 
+-- 
+2.50.1
+

---
base-commit: f5101638b9f917dc4c569828ff3fee0c486ba8f8
change-id: 20250802-fix_ngrep-59ab75bf5919

Best regards,

Signature · 6 lines
Thomas Bonnefille <[email protected]>

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Thomas Bonnefille via buildroot

Hello Thomas, All,

Le 02/08/2025 à 13:37, Thomas Bonnefille via buildroot a écrit :

Quoted 1 line

Please, can you provide your analysis on this issue?

From the patch, I understand that it's an error generated by gcc-14 (an newer). But ngrep package fail to build only when BR2_PACKAGE_LIBNET is selected.

I updated the commit log with a defconfig and the minimal gcc version to reproduce the issue.

Best regards,
Romain

Quoted 64 lines

---
This patch can be backported to 2025.02.x as this issue is reproducible on the current version of the LTS.

---
 ....h-and-tcpkill.h-to-avoid-implicit-functi.patch | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
package/ngrep/0006-Include-err.h-and-tcpkill.h-to-avoid-implicit-functi.patch new file +44 -1
new file mode 100644
index 0000000000000000000000000000000000000000..6d596bfe3791a33994179494e8c08ec7a9439975
@@ -0,0 +1,44 @@
+From 52515bae377f221b5473d9040f5f43ab1c672672 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <[email protected]>
+Date: Mon, 19 Dec 2022 11:49:06 +0100
+Subject: [PATCH] Include <err.h> and "tcpkill.h" to avoid implicit function
+ declarations
+
+Implicit function declarations are a historic language feature that
+were removed from C in 1999.
+
+Upstream: https://github.com/jpr5/ngrep/pull/28
+
+Signed-off-by: Thomas Bonnefille <[email protected]>
+---
+ ngrep.c   | 1 +
+ tcpkill.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/ngrep.c b/ngrep.c
+index 3df9389..b2fcceb 100644
+--- a/ngrep.c
++++ b/ngrep.c
+@@ -98,6 +98,7 @@
+ #endif
+ 
+ #include "ngrep.h"
++#include "tcpkill.h"
+ 
+ 
+ /*
+diff --git a/tcpkill.c b/tcpkill.c
+index 5388ec5..ac8fd2e 100644
+--- a/tcpkill.c
++++ b/tcpkill.c
+@@ -14,6 +14,7 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <string.h>
++#include <err.h>
+ #include <libnet.h>
+ #include <pcap.h>
+ 
+-- 
+2.50.1
+
 
---

base-commit: f5101638b9f917dc4c569828ff3fee0c486ba8f8
change-id: 20250802-fix_ngrep-59ab75bf5919

Quoted 1 line

Best regards,

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

#3 lore raw

Hello Romain,

Thanks for the review, but something is not clear. See below.

Quoted 9 lines · On Sat, 9 Aug 2025 23:52:55 +0200 Romain Naour <[email protected]> wrote:

Hello Thomas, All,

Le 02/08/2025 à 13:37, Thomas Bonnefille via buildroot a écrit :

Quoted 1 line

Please, can you provide your analysis on this issue?

From the patch, I understand that it's an error generated by gcc-14 (an newer). But ngrep package fail to build only when BR2_PACKAGE_LIBNET is selected.

So you ask for more details (which would encourage the submitter to send a new version of the patch)...

Quoted 2 lines

I updated the commit log with a defconfig and the minimal gcc version to reproduce the issue.

... but you say you have already updated the commit log with more details. So? Did you already apply the patch and sending a new iteration is not needed, or?

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Hello Thomas,

Le 10/08/2025 à 12:49, Thomas Petazzoni a écrit :

Quoted 20 lines

Hello Romain,

Thanks for the review, but something is not clear. See below.

Quoted 9 lines · On Sat, 9 Aug 2025 23:52:55 +0200 Romain Naour <[email protected]> wrote:

Hello Thomas, All,

Le 02/08/2025 à 13:37, Thomas Bonnefille via buildroot a écrit :

Quoted 1 line

Please, can you provide your analysis on this issue?

From the patch, I understand that it's an error generated by gcc-14 (an newer). But ngrep package fail to build only when BR2_PACKAGE_LIBNET is selected.

So you ask for more details (which would encourage the submitter to send a new version of the patch)...

Quoted 6 lines
Quoted 2 lines

I updated the commit log with a defconfig and the minimal gcc version to reproduce the issue.

... but you say you have already updated the commit log with more details. So? Did you already apply the patch and sending a new iteration is not needed, or?

Yes, I merged the patch with additional information in the commit log:

https://gitlab.com/buildroot.org/buildroot/-/commit/53d2ef7ec6fc406a23a5c5a13a4a3aefc8de3563

My initial intend was indeed to ask for more details but finally figured out what was the issue. I should have updated my email before sending it.

Best regards,
Romain

Quoted 4 lines

Thanks!

Thomas

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

#5 lore raw
In reply to Thomas Bonnefille via buildroot

In reply of:

Quoted 3 lines

Applied to 2025.02.x & 2025.05.x. Thanks

Quoted 62 lines

---
This patch can be backported to 2025.02.x as this issue is reproducible on the current version of the LTS.

---
 ....h-and-tcpkill.h-to-avoid-implicit-functi.patch | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
package/ngrep/0006-Include-err.h-and-tcpkill.h-to-avoid-implicit-functi.patch new file +44 -1
new file mode 100644
index 0000000000000000000000000000000000000000..6d596bfe3791a33994179494e8c08ec7a9439975
@@ -0,0 +1,44 @@
+From 52515bae377f221b5473d9040f5f43ab1c672672 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <[email protected]>
+Date: Mon, 19 Dec 2022 11:49:06 +0100
+Subject: [PATCH] Include <err.h> and "tcpkill.h" to avoid implicit function
+ declarations
+
+Implicit function declarations are a historic language feature that
+were removed from C in 1999.
+
+Upstream: https://github.com/jpr5/ngrep/pull/28
+
+Signed-off-by: Thomas Bonnefille <[email protected]>
+---
+ ngrep.c   | 1 +
+ tcpkill.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/ngrep.c b/ngrep.c
+index 3df9389..b2fcceb 100644
+--- a/ngrep.c
++++ b/ngrep.c
+@@ -98,6 +98,7 @@
+ #endif
+ 
+ #include "ngrep.h"
++#include "tcpkill.h"
+ 
+ 
+ /*
+diff --git a/tcpkill.c b/tcpkill.c
+index 5388ec5..ac8fd2e 100644
+--- a/tcpkill.c
++++ b/tcpkill.c
+@@ -14,6 +14,7 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <string.h>
++#include <err.h>
+ #include <libnet.h>
+ #include <pcap.h>
+ 
+-- 
+2.50.1
+
 
---

base-commit: f5101638b9f917dc4c569828ff3fee0c486ba8f8
change-id: 20250802-fix_ngrep-59ab75bf5919

Quoted 8 lines

Best regards,

Signature · 6 lines
Thomas Bonnefille <[email protected]>

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

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