Skip to contentSkip to conversation

src: doc: Re-order gcc args so nf-queue.c compiles on Debian systems

PATCH In review Duncan Roe 2 participants 5 messages Mar 19, 2025 – Mar 21, 2025 netfilter

lore
Share & tools
lore

Duncan Roe

author
#0 lore raw

PATCH 1/1 src: doc: Re-order gcc args so nf-queue.c compiles on Debian systems

Change the order of gcc arguments following the discussion starting at
https://www.spinics.net/lists/netfilter-devel/msg90612.html.
While being about it, update the obsolete -ggdb debug option to -gdwarf-4.

Fixes f0eb6a9c15a5 ("src: doc: Update the Main Page to be nft-focussed")
---
 src/libnetfilter_queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/libnetfilter_queue.c +1 -1
index f152efb..99799c0 100644
@@ -86,7 +86,7 @@
  * nf-queue.c source file.
  * Simple compile line:
  * \verbatim
-gcc -g3 -ggdb -Wall -lmnl -lnetfilter_queue -o nf-queue nf-queue.c
+gcc -g3 -gdwarf-4 -Wall nf-queue.c -o nf-queue -lnetfilter_queue -lmnl
 \endverbatim
  *The doxygen documentation
  * \htmlonly
Signature · 1 line
2.46.3
#1 lore raw
Quoted 16 lines · Duncan Roe

Change the order of gcc arguments following the discussion starting at
https://www.spinics.net/lists/netfilter-devel/msg90612.html.
While being about it, update the obsolete -ggdb debug option to -gdwarf-4.

Fixes f0eb6a9c15a5 ("src: doc: Update the Main Page to be nft-focussed")
---
 src/libnetfilter_queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/libnetfilter_queue.c +0 -0
index f152efb..99799c0 100644

src/libnetfilter_queue.c line 89

Quoted 5 lines
src/libnetfilter_queue.c +1 -1
@@ -86,7 +86,7 @@
  * nf-queue.c source file.
  * Simple compile line:
  * \verbatim
-gcc -g3 -ggdb -Wall -lmnl -lnetfilter_queue -o nf-queue nf-queue.c
+gcc -g3 -gdwarf-4 -Wall nf-queue.c -o nf-queue -lnetfilter_queue -lmnl

I am going t remove -g3 and -gdwarf-4, so it ends up with:

gcc -Wall nf-queue.c -o nf-queue -lnetfilter_queue -lmnl

to keep this example as simple as possible.

Quoted 7 lines
src/libnetfilter_queue.c +0 -0
 \endverbatim
  *The doxygen documentation
  * \htmlonly
Signature · 1 line
2.46.3
author
#2 lore raw

Hi Pablo,

Quoted 25 lines · Pablo Neira Ayuso
Quoted 16 lines · Duncan Roe

Change the order of gcc arguments following the discussion starting at
https://www.spinics.net/lists/netfilter-devel/msg90612.html.
While being about it, update the obsolete -ggdb debug option to -gdwarf-4.

Fixes f0eb6a9c15a5 ("src: doc: Update the Main Page to be nft-focussed")
---
 src/libnetfilter_queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/libnetfilter_queue.c +0 -0
index f152efb..99799c0 100644

src/libnetfilter_queue.c line 89

Quoted 5 lines
src/libnetfilter_queue.c +1 -1
@@ -86,7 +86,7 @@
  * nf-queue.c source file.
  * Simple compile line:
  * \verbatim
-gcc -g3 -ggdb -Wall -lmnl -lnetfilter_queue -o nf-queue nf-queue.c
+gcc -g3 -gdwarf-4 -Wall nf-queue.c -o nf-queue -lnetfilter_queue -lmnl

I am going t remove -g3 and -gdwarf-4, so it ends up with:

Quoted 1 line

gcc -Wall nf-queue.c -o nf-queue -lnetfilter_queue -lmnl

That makes nonsense of the previous line:

| you should start by reading (or, if feasible, compiling and stepping through with gdb) nf-queue.c

You can only step through nf-queue.c if you compile with the debug options.

Please leave them there.

Cheers ... Duncan.

author
#3 lore raw

Hi Pablo,

Quoted 13 lines · Duncan Roe

Hi Pablo,

Quoted 9 lines · Pablo Neira Ayuso

src/libnetfilter_queue.c line 89

Quoted 4 lines · Duncan Roe

* Simple compile line:
* \verbatim

src/libnetfilter_queue.c +1 -1
-gcc -g3 -ggdb -Wall -lmnl -lnetfilter_queue -o nf-queue nf-queue.c
+gcc -g3 -gdwarf-4 -Wall nf-queue.c -o nf-queue -lnetfilter_queue -lmnl

I am going t remove -g3 and -gdwarf-4, so it ends up with:

gcc -Wall nf-queue.c -o nf-queue -lnetfilter_queue -lmnl

Quoted 7 lines

That makes nonsense of the previous line:

| you should start by reading (or, if feasible, compiling and stepping through with gdb) nf-queue.c

You can only step through nf-queue.c if you compile with the debug options.

Please leave them there.

^^^^^^ ^^^^^ ^^^^ ^^^^^^
You chose to ignore this or maybe you just missed it?

I can send a patch to remove the reference to gdb in the previous paragraph or I can send a patch to reinstate the gcc debug options. Which would you prefer?

Cheers ... Duncan.

#4 lore raw
Quoted 18 lines · Duncan Roe

Hi Pablo,

Quoted 15 lines · Duncan Roe

Hi Pablo,

Quoted 9 lines · Pablo Neira Ayuso

src/libnetfilter_queue.c line 89

Quoted 4 lines · Duncan Roe

* Simple compile line:
* \verbatim

src/libnetfilter_queue.c +1 -1
-gcc -g3 -ggdb -Wall -lmnl -lnetfilter_queue -o nf-queue nf-queue.c
+gcc -g3 -gdwarf-4 -Wall nf-queue.c -o nf-queue -lnetfilter_queue -lmnl

I am going t remove -g3 and -gdwarf-4, so it ends up with:

gcc -Wall nf-queue.c -o nf-queue -lnetfilter_queue -lmnl

That makes nonsense of the previous line:

Quoted 7 lines
Quoted 5 lines

| you should start by reading (or, if feasible, compiling and stepping through with gdb) nf-queue.c

You can only step through nf-queue.c if you compile with the debug options.

Please leave them there.

^^^^^^ ^^^^^ ^^^^ ^^^^^^
You chose to ignore this or maybe you just missed it?

none of them, just disagreement.

Quoted 2 lines

I can send a patch to remove the reference to gdb in the previous paragraph or I can send a patch to reinstate the gcc debug options. Which would you prefer?

developers are familiar with debugging tools, there are more choices that gdb, -g is a "popular" flag, there is no need to document that many gcc options in the documentation, just a "Simple compile line" is fine.

I very much apologize for the discomfort this rises on you.

Thanks.