"Werror=pedantic" in the "openflow" function of ns-3.42

43 views
Skip to first unread message

Wagner de Oliveira

unread,
Dec 7, 2025, 10:44:04 PM (2 days ago) Dec 7
to ns-3-users
Good morning everyone,

1) The message "error: ISO C++ forbids zero-size (array/data/actions and others) [-Werror=pedantic]" continues to appear in the program when we run "./ns3 build", as shown in the image.

2) I am using:

- Ubuntu 24.04.3 LTS amd64
- Codename: noble
- ns-3.42

3) I ran the 3 (three) commands you recommended to disable the errors:

./ns3 configure --disable-werror
./ns3 configure --disable-warnings
./ns3 configure -- -DNS3_WARNINGS_AS_ERRORS=OFF

Is there another command to disable this error?

Even so, the errors continue to occur, as shown in the attachment. Could you help me?



Wagner
WERROR=PENDATIC-R01.pdf

Tom Henderson

unread,
Dec 7, 2025, 11:27:06 PM (2 days ago) Dec 7
to ns-3-...@googlegroups.com

Can you please tell us what compiler version generated this error, so we can try to reproduce?  For g++, the command is "g++ -v"; for clang++, it is similar ("clang++ -v").

I don't know offhand why the ns-3 commands are not working; we would have to take a look.

If you do not need the openflow module, you can delete the directory "ns-3.42/src/openflow".  If you do need to get the openflow module working, then you can try to modify the openflow source code (openflow is a separate library that provides openflow.h) to replace the syntax used for those structure declarations, to change '[0]' to '[]' for each instance of the warning:  e.g. 

struct ofp_phy_port ports[0];

would become

struct ofp_phy_port ports[];

Although I am not sure whether some compilers may still complain about this.

- Tom

Wagner --
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ns-3-users/5e507246-8021-4fef-9439-1ecc770fc489n%40googlegroups.com.

Tommaso Pecorella

unread,
Dec 8, 2025, 4:56:53 PM (2 days ago) Dec 8
to ns-3-users
Unfortunately I can confirm that the problem is in the openflow library, so it has to be fixed upstream.
You can try to pass the flag "-Wpedantic", which should disable that error. However, as usual, disabling errors comes with big caveats, i.e., you're waling on the thin ice.
If you don't need OpenFlow, the best option is to disable it, either by removing the module, or by removing the library.
Reply all
Reply to author
Forward
0 new messages